Enforce Timezone in Elastic Search Index - elasticsearch

I have net flow data that's DateTime is in local timezone (GMT+10). However when elastic search creates the index it assumes that the data is in UTC, therefore all my times are skewed. Just wondering if there is a way to say to elastic search that the data is in local and not UTC?

Related

how elastic store indexes

The elastic indexes are getting bigger and bigger and then some days the indexes are small. The days that indexes are small no machine is down; everything is the same as in the days the indexes are big.
I noticed that elasticsearch still store documents in the indexes from days before.
Is it possible that elastic pilling up the days before in the current day? How elastic stores the documents on indexes?
We had to decrease the days the indexes are stored since some days one index is 2x the size of another.
Thanks
#maryf there can be 2 possibilities here if there are date based indexes:
log shipper is not persisting the registry which contains info about which log files have ben harvested and upto what offset.
index is defined to use incorrect timestamp field for timelines.
In first case, whenever your log shipper restarts, it will start reading log files from beginning and you can see duplicate records in your index. While in the second case, logs are stored to the index based on the timestamp field being used. If the timestamp is from older date, it will be stored in older index matching the date.

Elasticsearch change internal timezone

i have a Elasticsearch cluster for storing logz, and my current timezone is+06, but Elasticsearch work in UTC +0, so how can i change the timezone in Elasticsearch cluster?
ES stores date-times in (UTC) and there's no cluster-/index-wide setting to change that.
With that being said, the time_zone parameter in available in both (range) queries and aggregations.
Also, as you index your date fields, there are (date)time formats that do support time zones. You can also use the date processor pipeline to append a certain time zone if your fields don't include one already.

ElasticSearch rollover index based on field

I'm a baby sitter learning Elastic Search. Here I'm pushing data from Kafka to ES using Kafka Connect. The data index size just grows and grows to TB's and its not easy to perform a search until I realized to have a new index hourly/daily, picking the date from the Document.
My document looks like:
{  
   "base":{  
      "message":"",
      "timestamp":"2019-08-09T13:20:11.877Z",
"type":"vpc"
   },
   "ecs":{  
      "version":"1.0.0"
   }
}
Now could I use the timestamp and type from the document to form a new index like 'vpc-2019.08.09-1'? That helps me create and direct documents to the index based on type and timestamp.
Taking a sample, we have an alias 'foo' which is defined as a time based alias with index format as foo-yyyy.mm.dd
We get a document at Jan 10, 2018 to write to the index. The ES client infers the index to be written to is foo-2018.01.10 and writes the data to the specified index or creates it if required.
We get another document at Jan 11, 2018 to write. Index inferred will be foo-2018.01.11 and written.
I came across this, based on system time. Doesn't help.
Any suggestions?

Aggregation by ID on Elasticsearch or by timestamp with unsupervised clustering

I have a data log entry stored in elasticsearch, each with its own timestamp. I now have a dashboard that can get the aggregation by day / week using Date Histogram aggregation.
Now I want to get the data in chunk (data logs are written several time per transaction, spanning for up to several minutes) by analyzing the "cluster" of logs according to its timestamp to identify whether it's the same "transaction". Would that be possible for Elastic search to automatically analyze the meaningful bucket and aggregate the data accordingly?
Another approach I'm trying is to group the data by transaction ID - however there's a warning that to do this I need to enable fielddata which will use a significant amount of memory. Any suggestion?

Kibana not identifying field as time-based

I'm using java API to index data into ElasticSearch and generate graphs in Kibana.
I have a field named "Event_TS" which holds values of type long (time at which event was created in milliseconds). I could generate Date Histograms using it.
(I'm getting JSON document from a separate method.)
But, when I finally reindexed the whole data, Kibana is not identifying "Event_TS" as time-based anymore and hence I can't generate Date Histograms. How do I resolve this?

Resources