Archives

AWK: how to get text which is between two strings

On 17.03.2012, in supportex.net-blog, by Oleksii Tykhonov
0

If you need to get some text which is in file between two lines you could use awk for this. You may need it while analyzing access logs to fix some issue, for instance. Here’s how you could do it: awk ‘/2012:00:20:49/, /2012:00:35/’ access_log > output It’s a simple and convenient way.

AWK: quick way to get squid users traffic usage

On 02.08.2011, in bash, by Oleksii Tykhonov
0

If you need quick and simple way to get squid users traffic usage you can use this script: Here is an example: [root@server ~]# head -n 50000 /var/log/squid/access.log | /usr/local/bin/traf.sh alice – size: 1532.08 Mb linda – size: 11.84 Mb cray – size: 9.30 Mb focus – size: 3.05 Mb santa – size: 0.96 Mb [...]