I am a little new to awk, so this question might have been asked, but I can't find a solution to my Question.
Using awk, I would like to search for a string in syslog, and only print the value until the next word boundary.
Rules:
- Only awk can be used
- Should be a one line Command in Linux
Test Data: Syslog contains entries made by the Firewall when packets are dropped. These lines of information contains multiple values and vary in length (forget NF). The source IP always start with SRC=
What I have so far:
awk '/SRC=/ { print $13 }' /var/log/syslog*
The problem however is that Field 13 is not always the SRC value.
The rest of the solution can be seen in this Question: Listing a Summary with limits
awk
?IFS
to)? Please edit your question and show us an actual example of your input data and your desired output.