I have chained input like this:
"input": {
"chain" : {
"inputs" : [{
"input_http" : {
"http" : {
"request" : {
"url" : "http://localhost:8080/list"
}
}
}
}, {
"input_es" : {
"search": {
"request": {
"indices": ["summary*"],
"body": {
"size": 0,
"query": {
"bool": {
"must": [
{
"query_string": {
"analyze_wildcard": true,
"query": "{{{{ CUSTOMIZATION HERE }}}"
}
}
],
"must_not": []
}
},
"_source": {
"excludes": []
}
}
}
}
}
}
]
}
}
I would like to customize my query in second input (input_es
) based on payload returned by first input (input_http
)
Example:
if ( ctx.payload.input_http._status_code = 200) {
"query": "HTTP_STATUS:200"
}
else {
"query": "!HTTP_STATUS:200"
}
How can I achieve this?
Thanks.