Delete old document automatically (version 6.5.4)

I want to delete old documents from elastic whenever a new record is inserted with the same request_id through logstash
Suppose my first log to be inserted in elastic is

6b06a196-0f9e-4bec-9c2c-17f4f6cdd652 tenant cloud data-1

Here 6b06a196-0f9e-4bec-9c2c-17f4f6cdd652 is my request_id
New Log is

6b06a196-0f9e-4bec-9c2c-17f4f6cdd652 tenant cloud data-2

So now when a new log is processed I want to delete the previous record corresponding to request_id from elastic

If you are indexing into a single index and not using time-based indices you would need to consistently use the request_id as document id to make the second document override the first. If not, then you need to explicitly perform a delete operation as there is no automatic way to ensure uniqueness across indices.

You are also running a very old version that has been EOL for a long time, so I would recommend you upgrade to the latest version.

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