Question
I have this string:
field1=text, CmdSet=[ CmdAV=first CmdArgAV=second CmdArgAV=third CmdArgAV=fourth ], field2=text
Is it possible to write a regex (one line) that will capture the below in a match group?
first second third fourth
Background
This is a syslog event coming from a Cisco ACS device. The event is being received by a SIEM solution. This SIEM solution allows us to use regex to "extract" information from the log by using match groups. We do this by typing in a "regex" line in an input field. So, for example, if I wanted to extract the value of the CmdAV
field, I would just do CmdAV\=(.*?)\sCmdArgAV
, and tell it to use "match group 1" (which is the only group here anyways). However, the "information" that I want to extract in my question is spread out into a single CmdAV
and several CmdArgAV
.
Thinking out loud, maybe a regex can be written to match everything between CmdAV=
and ], field=text
, and then "remove" any instance of CmdArgAV=
.
The documentation of this SIEM solution points to this: http://docs.oracle.com/javase/tutorial/essential/regex/ for more information on regex, so I'm guessing it uses Java.