Hi all,
I don't know how to give a dynamic value to this attributes field in google_pubsub output plugin.
Currently this is what I do, which is not DRY
output {
if [name] == "userRegistered" {
google_pubsub {
project_id => "a"
topic => "ab"
json_key_file => "abc"
attributes => {
"eventName" => "userRegistered"
}
}
}
}
This one tho, won't work, even tho the conditional statement can read from the name field
output {
if [name] == "userRegistered" {
google_pubsub {
project_id => "a"
topic => "ab"
json_key_file => "abc"
attributes => {
"eventNameA" => "%{[name]}"
"eventNameB" => "%{name}"
"eventNameC" => "[name]"
}
}
}
}
What am I missing here?