[CentOS] Log File Reviewing
Spiro Harvey
spiro at knossos.net.nzMon Jan 5 19:23:22 UTC 2009
- Previous message: [CentOS] Log File Reviewing
- Next message: [CentOS] Log File Reviewing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20090106/fb591e36/attachment-0001.sig>
- Previous message: [CentOS] Log File Reviewing
- Next message: [CentOS] Log File Reviewing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list