Created
January 8, 2016 19:49
-
-
Save sarwarbhuiyan/8b4c74ce7a7cbd9a2f56 to your computer and use it in GitHub Desktop.
date range filter improvement
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
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