-
-
Save rokcarl/6a5db307a9dd3dac2325cf7a20165648 to your computer and use it in GitHub Desktop.
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
curl -s -XPOST -H 'Content-Type: application/json' 'http://localhost:9200/stats*/_search' -d ' | |
{ | |
"aggs": { | |
"0": { | |
"date_histogram": { | |
"field": "timestamp", | |
"fixed_interval": "24h", | |
"time_zone": "Europe/Ljubljana", | |
"extended_bounds": { | |
"min": 1656626400000, | |
"max": 1657231200000 | |
} | |
} | |
} | |
}, | |
"size": 0, | |
"fields": [ | |
{ | |
"field": "timestamp", | |
"format": "date_time" | |
} | |
], | |
"script_fields": {}, | |
"stored_fields": [ | |
"*" | |
], | |
"runtime_mappings": {}, | |
"_source": { | |
"excludes": [] | |
}, | |
"query": { | |
"bool": { | |
"must": [], | |
"filter": [ | |
{ | |
"range": { | |
"timestamp": { | |
"format": "strict_date_optional_time", | |
"gte": "2022-06-30T22:00:00.000Z", | |
"lte": "2022-07-07T22:00:00.000Z" | |
} | |
} | |
} | |
], | |
"should": [], | |
"must_not": [] | |
} | |
} | |
} | |
' | jq '.aggregations."0".buckets[] | "\(.key_as_string),\(.doc_count)"' -r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment