On 17 Jan 2020, at 10:22, Patrick Peter via rsyslog wrote:
I am struggling to get a text(word) replaced in a particular string
written
by rsyslog, would you please help me in sharing the steps / template
and
configuration to make this work.
$template test_template,"%timestamp% %programname%
%msg:R,ERE,1,FIELD:(.*)text_to_replace:text_to_replace_with --end%"
I am far from an expert, so I don't know the "right" way to do a
substitution like you want. I'm not sure if it's possible. In a
similar situation I did something like this, which I think will work for
you.
$template test_template,"%timestamp% %programname%
%msg:R,ERE,1,FIELD:(.*)text_to_replace.*--end%
text_to_replace_with
%msg:R,ERE,1,FIELD:.*text_to_replace(.*)--end%"
Join this all together as one line, remove spaces that you do not want
in the output.
regards
danno
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE
THAT.