Skip to content

Instantly share code, notes, and snippets.

@sarwarbhuiyan
Created January 8, 2016 19:49
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 sarwarbhuiyan/8b4c74ce7a7cbd9a2f56 to your computer and use it in GitHub Desktop.
Save sarwarbhuiyan/8b4c74ce7a7cbd9a2f56 to your computer and use it in GitHub Desktop.
date range filter improvement
time curl "localhost:9200/stats-2016.01.05/nextgen-stats/_search?pretty" -d '{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"bool": {
"must": [
{
"range": {
"@timestamp": {
"gte": "now-12h/h",
"lte": "now"
}
}
}
],
"must_not": []
}
}
}
},
"size": 0,
"aggs": {
"2": {
"date_histogram": {
"field": "@timestamp",
"interval": "10m",
"pre_zone": "-06:00",
"pre_zone_adjust_large_interval": true,
"min_doc_count": 1,
"extended_bounds": {
"min": 1451982872960,
"max": 1452026072960
}
},
"aggs": {
"1": {
"sum": {
"field": "hmap_size"
}
}
}
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment