I have a working telegraf --> processor.regex.fields config.
So, I search for a regex pattern and y apply a replacement:
[[processors.regex.fields]]
key = “message”
pattern = ‘(.*?)(&submode=)([^\s\&]+)([^]+)’
replacement = “${3}”
result_key = “submode”
Everythink works great but… sometimes no “submode=” chain is present in message and I need a “default” value to be inserted in the influxdb…
Is there any way to apply a default value when there is no match?
Many Thanks in advance!!
Iban