Skip to content

Instantly share code, notes, and snippets.

@johanek
Forked from anonymous/esquery1.json
Last active October 2, 2017 13:49
Show Gist options
  • Save johanek/b0ac804fdb58b3b5fc9e922f999cacb3 to your computer and use it in GitHub Desktop.
Save johanek/b0ac804fdb58b3b5fc9e922f999cacb3 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"
}
}
},
"size": 0
}
{
"took": 380,
"timed_out": false,
"_shards": {
"total": 12,
"successful": 12,
"failed": 0
},
"hits": {
"total": 16435165,
"max_score": 0,
"hits": []
},
"aggregations": {
"timeseries": {
"buckets": [
{
"key_as_string": "2017-10-01T12:22:00.000Z",
"key": 1506860520000,
"doc_count": 8246
},
{
"key_as_string": "2017-10-01T12:23:00.000Z",
"key": 1506860580000,
"doc_count": 8599
},
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment