Hi,
I'm attempting to add tags via beats input into logstash using:
input {
beats {
host => "192.168.1.20"
port => 5045
client_inactivity_timeout => 0
tags => ["malware"]
}
}
filter {
if "malware" in [tags] {
grok {
# break_on_match => false
patterns_dir => "/etc/logstash/conf.d/patterns/mypatterns"
match => {
"message" => [
"%{DATESTAMP} %{WORD:zone} - %{LOGLEVEL:loglevel} - Total time taken: %{NOTSPACE:crontimetaken} \(M:S\)",
"%{DATESTAMP} %{WORD:zone} - %{LOGLEVEL:loglevel} - %{DATA:returnstatustext} %{INT:returnstatuscode}"
]
}
}
mutate {
convert => {
"[returnstatuscode]" => "integer"
}
}
}
}
output {
if "malware" in [tags] {
elasticsearch {
hosts => "192.168.1.20:9200"
manage_template => true
template_overwrite => true
index => "test-index-%{+YYYY.MM.dd}"
}
}
}
However it doesn't seem to pass any records into elasticsearch with this config, if I remove the tags section it passes the records in fine (obviously just without the tags).
I've also attempted to do this in filebeat using:
filebeat.prospectors:
- type: log
enabled: true
tags: [ "malware" ]
paths:
- /var/log/test.log
But again, it doesn't seem to pass the tag for me to search in Kibana.
Does anyone have any ideas as to why this may be?