Automatically add current timestamp when indexing

Can I have elasticsearch include the current timestamp when indexing a document, or is it necessary to add this from the application code that does the indexing? Any kind of default value feature where I could make it set the field to the current timestamp if no value is provided?

You can do that using an ingest pipeline.

Ive only used ingest pipelines when reindexing. How can I use them in this way?

I believe there is a link to a similar example towards the end of this blog post where a current timestamp is added to calculate the ingest delay.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.