Rule with dynamic parameter
- Dominant language
- Go
- Stars
- 337
- Forks
- 58
- PR merge metrics
- No merged PRs in 30d
Description
This is my rule
```
{
"location": "here",
"rule": {
"action": {
"code": "var msg ='Name :' + who + ' age : '+x; console.log(msg); msg;"
},
"condition": {
"and": [
{
"pattern": {
"age": "?x",
"name": "?who"
}
},
{
"code": "x >6"
}
]
},
"when": {
"pattern": {
"age": "?x",
"name": "?who"
}
}
}
}
```
In the above JSON, I am checking with constant 6 where age> 6 in my condition, but is there a way where I can pass a variable instead of fix values from the uri: /api/loc/events/ingest
For example
uri: /api/loc/events/ingest
request
```
{
"location": "here",
"event": {
"age": "8",
"name": "sonu"
}
}
```
The age passed here i.e. 8 should be used in the rule condition and the result should be according to that?
Contributor guide
Assessment
This issue has not been assessed yet.