Hi,
I am facing a challenge in displaying the dateTime field in local time zone.
When I filter the data in kibana 'Discover' I am getting the date and time in local time zone.
But when I query using the GET API in dev tools, I am not getting the results in local time zone but in UTC.
Below is the API I am running to fetch the data from 2020-08-25T00:00:00 to 2020-08-26T00:00:00.
`````````````````````````````````````````````````````````````````````
GET systemload-log/_search
{
"size": 10000,
"aggs": {
"range": {
"date_range": {
"field": "generateTime_readable",
"time_zone":"Asia/Calcutta",
"ranges": [
{
"from":"2020-08-25T00:00:00.000Z",
"to":"2020-08-26T00:00:00.000Z"
}
]
}
}
}
}
Below is the first hit and the generateTime_readable value is 2020-08-25T14:40:00.000Z.
The records from 2020-08-25T00:00:00 to 2020-08-25T14:39:00 are missing though it exists.
`````````````````````````````````````````````
"hits" : [
{
"_index" : "systemload-log",
"_type" : "_doc",
"_id" : "aJcPJnQBBTV2xJn45Ksl",
"_score" : 1.0,
"_source" : {
"host" : "xxx"
"memLoad" : "23",
"message" : "hidden",
"tenantId" : "2",
"diskLoad" : "6",
"port" : 56514,
"timestamp" : "2020-08-25T14:39:49+0000",
"Type" : "systemLoadLog",
"vsnId" : "0",
"cpuLoad" : "0",
"sessLoad" : "135",
"@timestamp" : "2020-08-25T14:40:09.617Z",
"applianceName" : "xxxx",
"@version" : "1",
"generateTime_readable" : **"2020-08-25T14:40:00.000Z"**,
"tenantName" : "test",
"applianceId" : "0",
"generateTime" : "1598366400"
}
},`
````````````````````````````````````````````````````````````````
Please help me to show the results in local time zone.