POST alertbrowser/_search?filter_path=aggregations.hourlyData.buckets
{
"query":{
"bool":{
"must": [
{
"match": {
"projectId": "aasish-webdemo-1-1498031057532"
}
}
],
"filter": [
{"range":{"page.time":{"gte":"now/d","lte":"now"}}}]
}
},
"aggs": {
"hourlyData": {
"date_histogram": {
"field": "page.time",
"interval": "hour",
"time_zone": "+05:30"
} }
}
}
Above query output is:
{
"aggregations": {
"hourlyData": {
"buckets": [
{
"key_as_string": "2017-11-28T05:00:00.000+05:30",
"key": 1511825400000,
"doc_count": 19
},
{
"key_as_string": "2017-11-28T06:00:00.000+05:30",
"key": 1511829000000,
"doc_count": 37
},
{
"key_as_string": "2017-11-28T07:00:00.000+05:30",
"key": 1511832600000,
"doc_count": 40
},
{
"key_as_string": "2017-11-28T08:00:00.000+05:30",
"key": 1511836200000,
"doc_count": 39
},
{
"key_as_string": "2017-11-28T09:00:00.000+05:30",
"key": 1511839800000,
"doc_count": 48
},
{
"key_as_string": "2017-11-28T10:00:00.000+05:30",
"key": 1511843400000,
"doc_count": 64
},
{
"key_as_string": "2017-11-28T11:00:00.000+05:30",
"key": 1511847000000,
"doc_count": 91
},
{
"key_as_string": "2017-11-28T12:00:00.000+05:30",
"key": 1511850600000,
"doc_count": 60
},
{
"key_as_string": "2017-11-28T13:00:00.000+05:30",
"key": 1511854200000,
"doc_count": 50
},
{
"key_as_string": "2017-11-28T14:00:00.000+05:30",
"key": 1511857800000,
"doc_count": 39
}
]
}
}
}
as in out put it is clearly showing that by adding time zone in query, it is showing result in from 05:00 Am,but data must be start from 12:00 AM, how to achieve this?If i am removing time zone then its shows data according to UTC?Please suggest................................