Created
February 12, 2021 08:54
-
-
Save rokcarl/a8bef790b940cc1cf16d5d1675be987b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"aggs": { | |
"2": { | |
"date_histogram": { | |
"field": "timestamp", | |
"fixed_interval": "60m", | |
"time_zone": "UTC", | |
"min_doc_count": 1 | |
}, | |
"aggs": { | |
"3": { | |
"terms": { | |
"field": "customer", | |
"order": { | |
"_count": "desc" | |
}, | |
"size": 1 | |
} | |
} | |
} | |
} | |
}, | |
"size": 0, | |
"stored_fields": [ | |
"*" | |
], | |
"script_fields": {}, | |
"docvalue_fields": [ | |
{ | |
"field": "timestamp", | |
"format": "date_time" | |
} | |
], | |
"_source": { | |
"excludes": [] | |
}, | |
"query": { | |
"bool": { | |
"must": [], | |
"filter": [ | |
{ | |
"term" : { | |
"customer": "[some-customer]" | |
} | |
}, | |
{ | |
"range": { | |
"timestamp": { | |
"gte": "2020-10-20T18:00:00.000Z", | |
"lte": "2020-10-20T21:59:59.999Z", | |
"format": "strict_date_optional_time" | |
} | |
} | |
} | |
], | |
"should": [], | |
"must_not": [] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment