Score:0

How to change sending messages with Rsyslog?

ru flag

i have following rsyslog messages which are going to rsyslog server and i would like to make hidden numbers eg from sip:023401412590 to sip:xxxxxxxxxxxx

does someone have a hint how to do following?

before

<16:11:24.332 **ERR** CAL 18507:18896 0:0> adsf from:<sip:[email protected]>;tag=XZD161HN0HZSm, to:<sip:[email protected]>;tag=asdf, warning:, contact:unknown

i want

<16:11:24.332 **ERR** CAL 18507:18896 0:0> adsf from:<sip:[email protected]>;tag=XZD161HN0HZSm, to:<sip:[email protected]>;tag=asdf, warning:, contact:unknown

numbers are there at least 2x times on different position a just some messages

thinking of something like that (based on How to edit sending messages with Rsyslog?)

$template deleteNumberTo,%msg:R,ERE,1:(.*) to:<sip:[0-9]* --end% to:<sip:xxxxxxxxxxxx %msg:R,ERE,1: to:<sip:[0-9]* (.*)--end%\n"
$template deleteNumberFrom,%msg:R,ERE,1:(.*) from:<sip:[0-9]* --end% from:<sip:xxxxxxxxxxxx %msg:R,ERE,1: from:<sip:[0-9]* (.*)--end%\n"


Module(load="imfile" PollingInterval="2")

Input(type="imfile"
File="/data/data.log"
Tag="ims:"
Severity="info"
Facility="user"
Template="deleteNumberTo"
Template="deleteNumberFrom"
)

thank you a lot for advices in advence michal

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.