-
Notifications
You must be signed in to change notification settings - Fork 307
Closed
Description
I'm using string expansion (i.e. %{foo}
) on document_id
setting:
elasticsearch {
document_id => "%{foo}"
}
The current behavior is:
- if the event has foo == "bar" then this string: "%{foo}" will return "bar"
- if a %{foo} value does not exist, then no substitution occurs.
As defined in https://github.com/elastic/logstash/blob/master/lib/logstash/event.rb#L224
I think it's safer to let ElasticSearch generates a document id rather than index a document with id %{foo}
. One major issue is that ElasticSearch will overwrite existing entries with the same ID %{foo}
😞
IMHO the default behavior for document_id
should be:
- if the event has foo == "bar" then this string: "%{foo}" will return "bar"
- if a %{foo} value does not exist, then return nil (and let ElasticSearch generates a document id)
(or at least make this behavior configurable)
Thanks
acristu
Metadata
Metadata
Assignees
Labels
No labels