Hello!
I'm trying to get heartbeat to perform an HTTP GET , while combining a JSON body with the GET request to the page.
My goal is to query an elastic index, take the fields and analyze for up/down accordingly.
In the particular instance, I'll query a logstash index for the last 1m to count the amount of logs via use of range query.
What's the proper syntax, or how can I debug a specific monitor.yml for syntax?
See below:
- type: http
id: logstash_index_stats
name: logstash_index_stats
schedule: '@every 1m'
urls: ["http://localhost:9200/logstash-*/_count"]
check.request:
method: GET
headers:
'Content-Type': 'application/json'
body: '{ "query" : { "range": { "@timestamp" : { "gte" : "now-1m", "lte" : "now" } } } }'
check.response:
status: [200, 201]
json:
- description: check log count
condition:
range:
count.gte: 1