I require a way to create a composite key for the document in elastic search through logstash corresponding to the composite key in my MySQL database.
I believe it's more a #logstash question so I moved your question.
Assuming you have the key in a field in each event, just reference that field with the %{fieldname}
notation in the elasticsearch output's document_id
option.
Thanks!
But by using document_id, we would be rewriting elasticsearch default id section.
My requirement is as follow
This is the description of my table, and i need the primary key associated with this table as it is in my elasticsearch.
But by using document_id, we would be rewriting elasticsearch default id section.
Yes. What's the problem with that?
If you for some reason want to keep ES's autogenerated document id but additionally have your own field that acts as a document key that's fine too, just use a mutate filter to add a new field with the contents of the other fields.
Thanks
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.