Is the below Logstash.conf file format correct? If not please let me know where I am wrong. Based on the log file path(inbuilt key) I want to change the index to another
input {
beats {
port => 5044
}
}
filter {
grok {
match => {"message" => "%{TIME:timestamp} \[%{DATA:type}\] %{LOGLEVEL:log-level} %{DATA:app_task}- %{GREEDYDATA:msg_data}"}
}
mutate {
remove_field => [ "[host]" ]
}
}
output {
stdout {codec => rubydebug}
if ["log.file.path"] == "/a/b/c/d/e.log" {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "abc"
}
}
else {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
}
}
}