Last active
December 12, 2015 01:41
-
-
Save SegFaultAX/5cc62b48411059558432 to your computer and use it in GitHub Desktop.
[elasticsearch] Example timestamp query
This file contains hidden or 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": { | |
"counts_by_servicetype": { | |
"aggs": { | |
"by_servicetype": { | |
"terms": { | |
"field": "servicetype", | |
"size": 0 | |
} | |
} | |
}, | |
"filters": { | |
"filters": { | |
"before_20151210000000": { | |
"range": { | |
"@timestamp": { | |
"lt": "2015-12-10T12:00:00", | |
"gte": "2015-12-10T00:00:00" | |
} | |
} | |
}, | |
"before_20151210120000": { | |
"range": { | |
"@timestamp": { | |
"lt": "2015-12-11T00:00:00", | |
"gte": "2015-12-10T12:00:00" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment