>>
>> It is really slow when 2-3 greps are combined.
>>
>
> But it will do the job until you solve this with more elegance.
>
> What you can try is to compile search pattern from 2-3 date outputs so
> it will match the text in the log.
>
>
> dayname="$(date "+%a")"; month="$(date "+%b")"; time="$(d
ankush grover wrote:
> 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 fir
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 w
John R Pierce wrote:
> On 06/13/11 12:36 AM, ankush grover wrote:
>> Hi Friends!
>>
>> I need to prepare a script which will grep logs from the current time
>> to previous 5 mins that is if the current time is Mon Jun 13 12:40:40
>> IST 2011 then all the logs between the interval Mon Jun 12:35 - 12
On 06/13/11 12:36 AM, ankush grover wrote:
> Hi Friends!
>
> I need to prepare a script which will grep logs from the current time
> to previous 5 mins that is if the current time is Mon Jun 13 12:40:40
> IST 2011 then all the logs between the interval Mon Jun 12:35 - 12:40
> 2011 should be grepped
Hi Friends!
I need to prepare a script which will grep logs from the current time
to previous 5 mins that is if the current time is Mon Jun 13 12:40:40
IST 2011 then all the logs between the interval Mon Jun 12:35 - 12:40
2011 should be grepped by the script and append it to another file.
However,
6 matches
Mail list logo