Re: Log File Reviewing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



> awk '$1 == "word"{print}' /var/log/messages

This example assumes that word is the first field and that it consists
only of "word". If the first field is "word1" this won't match.

Fixes for this are 

awk '$1 ~ "word"{print}'

(this matches any occurrance of "word" in the first field)

or:

awk '/^[[:space:]]*word/ {print}'

(this matches any line starting with whitespace followed immediately by
"word")


-- 
Spiro Harvey                  Knossos Networks Ltd
021-295-1923                    www.knossos.net.nz

Attachment: signature.asc
Description: PGP signature

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux