Here is my logstash config file, the issue is logstash not forwarding logs to all outputs, only 2 outputs are working
output {
if [fields][component] == "cat" {
file {
path => "/data/cat/cat.%{+yyyy.MM.dd}"
}
}
else if [fields][component] == "idt256" {
file {
path => "/data/idt256/idt256.%{+yyyy.MM.dd}"
}
}
else if [fields][component] == "idt512" {
file {
path => "/data/idt512/idt512.log.%{+yyyy.MM.dd}"
}
}
else if [fields][component] == "ida" {
file {
path => "/data/ida/ida.log.%{+yyyy.MM.dd}"
}
}
elasticsearch {
hosts => ["https://node1:9200"]
user => 'elastic'
cacert => '/opt/elasticsearch/ca/ca.crt'
password => 'password'
manage_template => false
index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
}
}
the first and last (cat&ida) output is working , remaining not can anyone please suggest what's wrong in if condition?