I can't figure out how to rename fileds based on the pattern.
At the moment, in Logstash (6.5) I have a banch of filters:
mutate { rename => { "sensor_source_a" => "sensor.labels.a" } }
mutate { rename => { "sensor_source_b" => "sensor.labels.b" } }
mutate { rename => { "sensor_source_c" => "sensor.labels.c" } }
I need to make some more automated filter which independently of the last element will always rename the pattern:
"sensor_source_xxx" into "sensor.labels.xxx"
I am trying different approaches together with ruby code but can't find simple solution.
What would be the most siutable filter for such opearation