Noob question here (or dumb on a Sunday morning ). I am getting one of these when tryng to register a watch:
{"error":"WatcherException[failed to put watch [mysql_slow_watch]]; nested: InputException[could not parse input for watch [mysql_slow_watch]. unknown input type [condition]]; ","status":500}
My Watch looks like this:
curl -XPUT 'http://[my_host]:[my_port]/_watcher/watch/mysql_slow_watch' -d '{
"trigger" : {
"schedule" : { "interval" : "10s" }
},
"input" : {
"search" : {
"request" : {
"indices" : [ "myindex" ],
"body" : {
"query": {
"bool": {
"must": [
{
"range": {
"query_data.queryTime": {
"from": 10
}
}
}
],
"must_not": [],
"should": []
}
},
"filter": {
"range": {
"@timestamp" : {
"from": "{{ctx.trigger.scheduled_time}}||-10s",
"to": "{{ctx.trigger.triggered_time}}"
}
}
}
}
}
},
"condition" : {
"compare" : { "ctx.payload.hits.total" : { "gte" : 1 }}
},
"actions" : {
"log_error" : {
"logging" : {
"text" : "Found {{ctx.payload.hits.total}} Slow Queries Found"
}
}
}
}'
Can someone tell me what I have missed here? Do I have to create a mapping for 'mysql_slow_watch', like a normal ES index (I thought that was what this should do).
Thanks
Peter C