Print field x in a space separated gzipped logfile

In the below case x is 2 (numbering starts from zero).

gunzip -c access.log.1.gz | perl -ne '@a=split / +/, $_; print $a[2]."\n"'
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.