Hello,
I am trying to use the value of a field, but I do not know why, I have the impression that the cipher plugin cannot read it. Could you help me figure out what's wrong please?
Below, I stored the value of "algorithm" in "[@metadata] [algorithm]" :
OK :
input { stdin { } }
filter {
mutate {
add_field => { "[@metadata][encrypted]" => "gKHInKhQooaPgF7m99B465HN4Wi5+ESCjq5LTc69h/I5+/fSsEbxGjk0NpiNrpH8" }
}
cipher {
algorithm => "aes-256-cbc"
iv_random_length => 16
key => "12345678901234567890123456789012"
key_size => 32
mode => "decrypt"
source => "[@metadata][encrypted]"
target => "[@metadata][decrypted]"
}
}
output { stdout { codec => rubydebug { metadata => true } } }
NOT OK :
input { stdin { } }
filter {
mutate {
add_field => {
"[@metadata][encrypted]" => "gKHInKhQooaPgF7m99B465HN4Wi5+ESCjq5LTc69h/I5+/fSsEbxGjk0NpiNrpH8"
"[@metadata][algorithm]" => "aes-256-cbc"
}
}
cipher {
algorithm => "%{[@metadata][algorithm]}"
iv_random_length => 16
key => "12345678901234567890123456789012"
key_size => 32
mode => "decrypt"
source => "[@metadata][encrypted]"
target => "[@metadata][decrypted]"
}
}
output { stdout { codec => rubydebug { metadata => true } } }
Thank you so much,
Florent