Skip to content

Instantly share code, notes, and snippets.

@aodj
Created September 15, 2015 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aodj/0ba7a4225d7994f430a2 to your computer and use it in GitHub Desktop.
Save aodj/0ba7a4225d7994f430a2 to your computer and use it in GitHub Desktop.
{
"size": 0,
"query": {
"filtered": {
"query": {
"query_string": {
"analyze_wildcard": true,
"query": "_type:logs"
}
},
"filter": {
"bool": {
"must": [
{
"range": {
"event_time": {
"gte": "$timeFrom",
"lte": "$timeTo"
}
}
}
]
}
}
}
},
"aggs": {
"2": {
"date_histogram": {
"interval": "$interval",
"field": "event_time",
"min_doc_count": 1,
"extended_bounds": {
"min": "$timeFrom",
"max": "$timeTo"
}
},
"aggs": {}
}
}
}
@aodj
Copy link
Author

aodj commented Sep 15, 2015

Line 15 and 31 needed to be changed from @timestamp to event_time to get my data to show correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment