Hi,
I would like to append the letter C to this key:
"module-temp": 32.37
so that it looks like "module-temp": 32.37 C
Tried this but didn't work:
if ("*" in [module-temp]) {
mutate {
replace => {"module-temp" => "%{module-temp} C"}
}
}
Badger
March 1, 2022, 5:28pm
2
What are you trying to test using that conditional? The mutate+replace looks good.
I was just trying an alternate to:
if [module-temp] {
mutate {
replace => {"module-temp" => "%{module-temp} C"}
}
}
What you have here works if you use your second conditional statement method.
Conf
input {
generator {
message => '{"module-temp": 32.37} '
count => 1
codec => "json"
}
}
filter {
if [module-temp] {
mutate {
replace => {"module-temp" => "%{module-temp} C"}
}
}
}
output {
stdout { }
}
Output
"module-temp": "32.37 C"
system
(system)
Closed
March 29, 2022, 7:54pm
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.