Watcher actions body How to save search query
watcher configure:
{
"trigger": {
"schedule": {
"interval": "10s"
}
},
"input": {
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"logstash-*"
],
"rest_total_hits_as_int": true,
"body": {
"query": {
"bool": {
"must": {
"match": {
"path": "/api/v1"
}
},
"filter": {
"range": {
"@timestamp": {
"from": "{{ctx.trigger.scheduled_time}}||-5m",
"to": "{{ctx.trigger.triggered_time}}"
}
}
}
}
}
}
}
}
},
"condition": {
"compare": {
"ctx.payload.hits.total": {
"lt": 10
}
}
},
"actions": {
"ops": {
"webhook": {
"scheme": "http",
"host": "xxx",
"port": 5000,
"method": "post",
"path": "/xxx",
"body": "{{#toJson}}ctx{{/toJson}}"
}
}
}
}
I'am want to add input search query or kibana search query url in webhook body, How?