I've a syslog message like this:
03-25-2022 18:02:51 Local1.Notice 192.168.1.1 Mar 25 18:02:51 2022 192.168.1.1 stm[6358]: <501199> <NOTI> AP:AP01 <192.168.1.1 aa:bb:cc:dd:ee> User authenticated, mac-aa:bb:cc:dd:ee, username-my.username, IP-192.168.250.100, method-802.1x, role-blahblah
My first goal is: everytime that the line contains "User authenticated", extract the string that comes after username- (in this case: my.username) and prepend a string.
Wanted Result:
MYPREPENDSTRING\my.username
Second goal: After that I would need another REGEX that can extract the ip address in this line that starts with IP- (IP-192.168.250.100). Final result:
Wanted result:
192.168.250.100
These two goals have to be done only with regex... don't know if it's possible.
NOTE: This is to be used on a Firewall that allows us, via Syslog, to map usernames and IP's. It uses 1 regex to match the username and another regex to match the ip
Much appreciated!!