I'm trying to capture text via regular expression and replace the text with a custom string.
My current code successfully captures IP addresses, but I don't know how to replace the IP address with custom text along with the rest of the message:
$Template privateIP,"%TIMESTAMP% %HOSTNAME% %syslogtag% %msg:R,ERE,0,DFLT:([0-9]{1,3}\.){3}[0-9]{1,3}--end%\n"
My first thought is to somehow move the regex out of the template (i.e. with some RainerScript) and create a new field/variable modded_msg
that is set to a modified msg
property. And then use %modded_msg%
in the $Template.
I've tried multiple times (thanks, ChatGPT), but can't get it to work.