Tools to break apart large log files.

David Christopher Chipman dchipman-rYHPKw+MWrk at public.gmane.org
Thu Dec 10 04:40:11 UTC 2009


Scott Sullivan wrote:
> The log files have a time stamp at the front of each line, like this:
>
> [2009/12/09 19:10]  UserA: Text
> [2009/12/09 19:11]  UserB: Responce
> [2009/12/09 19:11]  UserB: More Text
> [2009/12/09 19:11]  UserA: ??? Profit
>
> I want something that will register when the gap between the time 
> stamps is greater then a given value and split them out to separate 
> files.
>
> On 12/09/2009 10:14 PM, Chris F.A. Johnson wrote:
>> On Wed, 9 Dec 2009, Scott Sullivan wrote:
>>
>>   
>>> What I Have:
>>>      Chat log files that span multiple months (like IRC channel logs).
>>>
>>> What I want:
>>>      To break those large files into many smaller files based on a 
>>> certain time
>>> gag between posts.
>>>      ie. Break to new file IF time between lines n and n+1 is>  2 hour.
>>>      
>>     Use awk. Without seeing what the files look like, I can't be more
>>     specific.
>>
>>    
> -- 
> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
>
>
Scott,

I'm no big fan of perl, but I would think it would be the better choice, 
then awk. You can do text parsing,  math, and variable comparison. These 
are all things you'll need to do for this.

-David
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list