I am attempting to use a dynamic/event dependent config (as shown here https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html) however I keep getting an errror.
I am trying to output data to sentry depending on the severity, and the type of log that it is processing.
This is what the output section looks like
sentry {
host => '192.168.1.101'
key => 'b3921923d34c4344878g7a83e2061229'
secret => 'd0163as306c04148aee49fe4ae7621b1'
project_id => '2'
msg => "[@metadata][sentry][id]"
level_tag => "[sentry]" (have also tried "%{sentry}", %{sentry}, "[@metadata][sentry][severity]" ) etc.
#level_tag => "fatal"
}
And this is what my filter looks like..
filter {
if [type] == "syslog" {
mutate {
add_field => {"[@metadata][sentry][id]" => "%{host}"}
# add_field => { "[sentry_severity]" => "%{severity}" }
add_field => {"sentry" => "fatal"}
# add_field => {"[@metadata][sentry][severity]" => "fatal" }
}
}
}
This is what sentry is receiving..
{
"name": "level",
"value": "[sentry]"
}
the part I am having an issue with is 'level_tag => "[sentry]" ' (as you can see I have tried a handful of variables without success) I would prefer to use a metadata one..
I have tried every type of interpolation there that I can find and no matter what it keeps passing in the variable name as opposed to the data contained in the variable.. however when I do a std out it DOES show that the variable IS set to the right string.
Any help is sooooo appreciated..
What I would hope to do is be able to have host, key, secret, project_id, level tag, all variables that are set in the filters section...
Thanks!
Josh