Setting unique _id

Hi, in my application I have to prevent the insertion of duplicates, so what I did until now is to set as _id a digest of my message.
But I realized that two documents in different index can have same _id.

My index pattern:
logstash-YYYY.DD.MM

So if the same message arrives in two different days I will have two log entries with the same _id.

Is there a way to have a unique index per pattern or the only solution is to have just one index?

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