0

just need simple regex I can use to match action from firewall logs. My log looks like this I want to extract just action="whatewer_it_could_be"

repeat-count="0" action="NONE" threat-severity="HIGH"

thank you

/edit I need just regex to put into our external software which is parsing raw logs

1 Answers1

0

You did not tell us the OS you are using. Assuming Linux or similar OS, you can awk to extract the needed value from a log file following the same format shown above.

awk '{ print $2 }' /path/to/log/file | awk -F '=' '{ print $2 }'

You can grep for specific lines (before awk) if you want for example to extract them for specific threat-severity.

Khaled
  • 36,903