I am just having a second thought about this:
My reply was based on the assumption, that the different parts of the final message are in different Varbinds of the Trap.
But you might mean that only one of the Varbinds contains the complete message.
Then the problem is, that all the Varbinds are separated by Comma (that is the default behavior of the connector), and your message contains Commas as well.
There is no way to tell the system which commas belong to which part (separator or part of Message) - unless you know exactly how many commas you have in your message.
If you know the amount of commas in your message, you can use a two step parse (as an example I am using Part2 for the Message with two commas):
<Parse> <Field input='snmp_varbindvals' output='Part1,Part2,Part3' pattern='^(.*?),(.*?,.*?,.*?),(.*?)$'/> <Field input='Part2' output='Var1,Var2,Var3' pattern='^(.*?),(.*?),(.*?)$'/>
</Parse>
If you don't know the amount of commas, there is no solution, because there is no "Replace" in the code.
Then you don't know into how many parts to parse the message and how often to perform the reformatting step I listed in my previous message.
Michael
------------------------------
Customer Success Architect
CA Deutschland GmbH (a Broadcom company)
------------------------------
Original Message:
Sent: 07-31-2019 04:21 PM
From: Joseph Poutre
Subject: Reformat comma'd message within SOI
Hello all,
We are sending traps from multiple monitoring systems into SOI as our master monitoring console.
The trap messages are in a format like this, as is typical:
VAR1=value1, VAR2=value2, VAR3=value3
For human readability we'd like to present it in a format like this:
VAR1=value1
VAR2=value2
VAR3=value3
I've tried a variety of regex combinations to convert the ", " into a CRLF. I've tried dropping the space after the comma but it made no different. I've tried \n, \r,. and \r\n, and variations thereupon.
Any ideas? Or am I going to have to bring in a preformatting step?
Thank you,
Joe Poutre
BNP Paribas