December 2017
Intermediate to advanced
434 pages
10h 29m
English
We actually want to slice the data by IST time zone rather than slicing it according to the UTC time zone. This is possible by specifying the time_zone parameter. We need to separate the offset of the required time zone from the UTC time zone. In this case we need to provide +05:30 as the offset, as IST is 5 hours and 30 minutes ahead of UTC:
GET /bigginsight/usageReport/_search?size=0{ "aggs": { "counts_over_time": { "date_histogram": { "field": "time", "interval": "1d", "time_zone": "+05:30" } } }}
The response now looks like the following:
{ ..., "aggregations": { "counts_over_time": { "buckets": [ { "key_as_string": "2017-09-23T00:00:00.000+05:30", "key": 1506105000000, "doc_count": 62493 }, { "key_as_string": ...Read now
Unlock full access