[CentOS] Unable to grep 5 mins logs

ankush grover ankushcentos at gmail.com
Mon Jun 13 12:59:35 UTC 2011


Combine 2-3 greps:
>
> for (( i = 5; i>=0; i-- )) ; do grep `date "+%a"` | grep `date "+%b"` |
> grep `date "+%d"` | grep `date "+%Y"` | $(date "+%R" -d "-$i
> min") /var/ossec/logs/active-responses.log>>  /tmp/newlog.log;done
>
> Change order of greps to gain speed at first cutting part of lines with
> most hits.
>
> Ljubomir
> _

It is really slow when 2-3 greps are combined.

______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>



More information about the CentOS mailing list