Hello,
within my Logstash config I'm searching for a regex pattern. If a logfile is found which matches the regex a new field should be added with the found pattern.
The if statement is working but I don't know how to save the exact pattern to a new field. This is my code at the moment:
input {
stdin { }
}
filter {
if [message] =~ "[0-9|A-Z]{11}" {
mutate {
add_field => {"message-id" => "found pattern from above" }
}
}
output {
stdout { codec => rubydebug }
}