Hi
Can following configuration :
output {
if([type] == "A"){
elasticsearch{
hosts => ["localhost:9200"]
index => "aaa"
document_type => "_doc"
document_id => "11"
http_compression => true
manage_template => true
template => "logstash-6.4.2/config/pipelines/Templates"
template_name => "errt"
}
}else if([type]=="B"){
elasticsearch{
hosts => ["localhost:9200"]
index => "aaa"
document_type => "_doc"
document_id => "11"
action => "update"
script_lang => "painless"
script_type => "inline"
script => ''
}
}else{
stdout { codec => rubydebug }
}
}
Be written as :
output {
elasticsearch{
hosts => ["localhost:9200"]
index => "aaa"
document_type => "_doc"
document_id => "11"
http_compression => true
if([type] == "A"){
manage_template => true
template => "logstash-6.4.2/config/pipelines/Templates"
template_name => "errt"
}else if([type]=="B"){
action => "update"
script_lang => "painless"
script_type => "inline"
script => ' '
} else{
stdout { codec => rubydebug }
}
}
}