I'm pretty new to logstash. I have an index called person in Kibana. The index includes firstname, lastname, email, address... Now I need to update person's address by using a table in database. My table only have emails and new addresses. I want to retrieve id in the elasticserach filter.
Here's my config file:
input {
jdbc{
#jdbc library, connection string...
}
statement => "select email, address from person_table"
}
filter{
elasticsearch {
host =>"myhost"
index => "person"
query => "email_field:%{email}"
fields => ["id"] # I want to retrieve id here and use it later, but couldn't make it work.
}
}
output{
elasticsearch {
host =>"myhost"
index => "person"
action => "update"
doc_as_upsert => "true"
document_id => "%{id}"
}
docinfo is not availble in filter. How can I get the id?