Answer the question
In order to leave comments, you need to log in
How to replace part of text in rsyslog msg?
The rsyslogd server on CentOS was raised, logs are collected, incl. with ViPNet HW1000 coordinator, such messages come:
Message [03-18 16:54:19] CConfig.UpdateIpsForId: natsettings for NNNN002A: firewallip=192.168.1.101, forwardip=192.168.1.101, port=55777, timeout=0, virtualip=A000019, proxyid=NNNN000A, flags:BROADCAST ELAPSE
template(name="logline" type="string" string="%HOSTNAME% %syslogtag% %$!msg%\n")
if (re_match($msg,"NNNN002A")) then {
set $!msg = replace($msg, "NNNN002A", "АП Узел 10");
} else {
set $!msg = $msg;
}
if ( $programname startswith "iplircfg" and $!msg contains "CConfig" ) then {
action(type="ommysql" server="127.0.0.1" db="Syslog" uid="syslog" pwd="syslog")
stop
}
if ( $programname startswith "iplircfg" ) then {
action(type="omfile" file="/dev/null" flushOnTXEnd="off")
stop
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question