How to filter beat data by version on logstash ?
I tried code as belw on logstash config , but it did not work. I want to filter out version 6.8.6 data
input {
beats {
port => 5044
}
}
filter {
if [agent.version] == "6.8.6" { drop { } }
if ["%{[@metadata][version]}"] == "6.8.6" { drop { } }
}
output {
elasticsearch {
hosts => ["192.168.0.37:9092"]
manage_template => false
validate_after_inactivity => 60000
index => "filebeat-%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
}
stdout {
codec => rubydebug
}
}