Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
"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