Hi team,
I am using heartbeat to monitor some url's.
I am trying to create a watcher alert for 1 specific url but I get stuck. Here is my code:
{
"trigger": {
"schedule": {
"interval": "1m"
}
},
"input" : {
"search" : {
"request" : {
"indices" : [ "heartbeat**" ],
"body" : {
"size" : 1,
"sort" : {
"@timestamp" : { "order" : "desc"}
},
"query": {
"match" : {
"url.domain" : {
"query" : "URL"
}
}
}
}
},
"extract": [ "summary.down" ]
}
},
"condition" : {
"compare" : { "ctx.payload.hits.total" : { "eq" : 1 }}
},
"actions": {
"my_webhook": {
"webhook": {
"scheme": "https",
"host": "",
"port": 443,
"method": "POST"
}
}
}
}
So url.domain is a field. Which I am trying to match only one url to get the events of that.
Summary.down is a field which can contain a 1 or 0.
I hope somebody can help me with this.
Best regards,
Robin