I would like to send 2 different format message to outputs so I have something like this
input {
beats {
port => 5044
}
}
filter {
clone {
clones => ["message"]
add_tag => ["siem"]
}
if "siem" not in [tags] {
json {
source => "message"
remove_field => [ "agent", "host", "input", "ecs", "tags", "log" ]
}
}
if "siem" in [tags] {
json {
source => "message"
remove_field => [ "agent", "host", "input", "ecs", "log" ]
}
mutate {
replace => {"message" => "%{local_time} %{level_name} %{message} %{ip} %{user} %{uri}" }
}
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "audit_%{+YYYY.MM.dd}"
manage_template => true
template => "/usr/share/logstash/template/audit.json"
template_name => "audit"
template_overwrite => true
}
if "siem" in [tags] {
udp {
host => "<host>"
port => "<port>"
}
file {
path => "/var/log/logstash/siem.log"
}
}
}
but in siem.log there is still json message