Skip to content

Instantly share code, notes, and snippets.

Created October 2, 2017 13:35
Show Gist options
  • Save anonymous/90c7e6e495723b2edcca816f1b36c102 to your computer and use it in GitHub Desktop.
Save anonymous/90c7e6e495723b2edcca816f1b36c102 to your computer and use it in GitHub Desktop.
ES query
{
"query": {
"bool": {
"must_not": [],
"must": [
{
"range": {
"@timestamp": {
"gte": "2017-10-01T13:21:03.914477+01:00",
"lte": "2017-10-02T13:21:03.914401+01:00"
}
}
},
{
"query_string": {
"query": "type:farm_stats AND site:london"
}
}
]
}
},
"aggs": {
"timeseries": {
"date_histogram": {
"field": "@timestamp",
"interval": "minute"
},
"aggs": {
"our_aggregation": {
"count": {
"field": "exit_status"
}
}
}
}
},
"size": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment