Hi, i'm new on ES, i'am using logstash and csv to update or delete values into ES.
I want to delete or update document based on different field not only with document_id
like this:
input {
stdin{}
}
filter {
csv {
separator => ","
skip_header => "true"
columns => ["productCode","productName","productLine","operation"]
}
}
output {
if [operation] == "delete" {
elasticsearch {
action => "delete"
delete by product code
index => "product"
hosts => ["127.0.0.1:9200"]
}
}if [operation] == "update" {
elasticsearch {
action => "update"
update by product code
index => "product"
hosts => ["127.0.0.1:9200"]
}
}
stdout { codec => rubydebug }
}
In this case, product code is not the document_id. I don't have the document id in the csv, so i'am not able to find the specific document to delete or update, i have only product code or maybe other fields.
Can i do something like this?