0
嗨,我有使用logstash更新弹性的多个记录的问题。 我logstash配置波纹管使用logstash更新弹性的多个记录
output {
elasticsearch {
hosts => "******"
user => "xxxxx"
password => "yyyyyy"
index => "index_name"
document_type => "doc_type"
action => "update"
script_lang => "painless"
script_type => "inline"
document_id => "%{Id}"
script => 'ctx._source.Tags = params.event.get("Tags");'
}
}
我输出到logstash转储文件夹的样子: {"index_name":"feed_name","doc_type":"doc_type","Id":["b504d808-f82d-4eaa-b192-446ec0ba487f", "1bcbc54f-fa7a-4079-90e7-71da527f56a5"],"es_action":"update","Tags": ["tag1","tag2"]}
我最大这里的问题是,我不能够同时更新这两个recods但我需要创建两个不同ID的记录。
是否有为什么通过在我的输出配置中编写查询来解决此问题? 在SQL中看起来成才这样的:
Update Table
SET Tags
WHERE ID in (guid1, guid2)
我知道,在这种情况下,我可以在logstash和问题就解决了添加两个记录,但我需要解决的第二个问题,我需要更换有一个所有记录tag1并给它newTag。