What is the use of the mandatory @timestamp field in elasticsearch datastream

Viewed 557

I'm currently examining the migration of an old ES cluster into an ILM managed https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html

I do not fully understand the role of the required @timestamp field. I understand that writes are being directed to the write index while reads are being directed to all backing index. If writes are going to the current write index anyway, why does ES cares about the @timestamp field at all?

1 Answers

A data stream works with append-only time series, which are collections of documents with a time dimension. Therefore, your documents must have a field that makes the time dimension explicit, e.g., when the document was created or when the represented event originated. For a data stream, such a field is @timestamp. Thanks to this field, ES can apply time-based rollover policies and create those write/backing indices you mentioned

Related