I’m trying to compare some raw data with elasticsearch data source in grafana but i got an issue with date time.
My document contains two date fields. For Grafana data source it’s just start
chosen.
Document in ES:
{
"_index": "plc_2_states-2019-01",
"_type": "default",
"_id": "df3a86539d3349e59bc3a5f37256b3ae",
"_score": null,
"_source": {
"start": "2019-01-15T23:21:02.094392",
"end": "2019-01-16T00:05:15.888564",
"duration": 2653794,
"name": "Antest"
}
}
I’m using the table panel and chose raw document
, so my JSON row looks like this:
{
"_id": "df3a86539d3349e59bc3a5f37256b3ae",
"_type": "default",
"_index": "plc_2_states-2019-01",
"start": [1547594462094],
"end": "2019-01-16T00:05:15.888564",
"duration": 2653794,
"name": "Antest"
}
What i’ve noted here is the different format of timestamp between start and end.
Now i tried to transform the data so it’s converted to a table, then i got my issue:
I’ve changed my column styles and chose date for start and end. Because of start is treated like a unix timestamp and dashboard settings are set to local browser time grafana converts start to a local time, in my case +1:00. end field stays the same. If i try to change dashboard settings to UTC then start field is correct but end field loses 1 hour.
All date time fields in Elasticsearch are UTC without any timezone informations.
See result here:
I’m not sure, if it’s a grafana issue or maybe dates in elasticsearch should be saved different. What should i do to get raw data informations?
Elasticsearch version: 5.6
Grafana: 5.4.1