[ale] Help Processing a Log File

James P. Kinney III jkinney at localnetsolutions.com
Wed May 12 22:32:26 EDT 2004


Well, I was going to wade in and offer my solution. It had hit about 30+
lines and was growing.

Then I saw Geoffrey's solution and decided it was _MUCH_ faster and way
less typing!

When Fletch chimes in with his one liner that takes me longer to
understand than type with one finger, I will be completely humbled.

Learning new stuff every day....

On Wed, 2004-05-12 at 19:56, Jonathan Glass wrote:
> I'm trying to parse a printer log file.  Here is a snippet of a single
> print job (I added the extra lines for legibility):
> -----------
> jobstart '-HMUTT' '-nomard' '-Plp' '-kcfA008MUTT' '-b752686'
> '-t2003-02-18-16:15:53.000'
> 
> start '-q29645' '-p241810' '-t2003-02-18-16:15:55.087' '-Aomard at MUTT+8'
> '-nomard' '-Plp'
> 
> filestart '-q29646' '-p241810' '-t2003-02-18-16:15:57.095'
> '-Aomard at MUTT+8' '-nomard' '-Plp'
> 
> fileend '-b9' '-T36' '-q29646' '-p241819' '-t2003-02-18-16:16:31.076'
> '-Aomard at MUTT+8' '-nomard' '-Plp'
> 
> end '-b9' '-T42' '-q29645' '-p241819' '-t2003-02-18-16:16:35.070'
> '-Aomard at MUTT+8' '-nomard' '-Plp'
> 
> jobend '-HMUTT' '-nomard' '-Plp' '-kcfA008MUTT' '-b752686'
> '-t2003-02-18-16:16:35.000'
> 
> -----------------
> 
> All I need to do is pull out the user (-nomard, -name omard) and the
> number of pages printed (fileend -p241819, subtract filestart -p241810).
> 
> I can think of ways of pulling a single variable out (username, #pages
> at start, #pages at end), but can't figure out how to pull out all 3
> simultaneously.
> 
> i'm hoping to parse through the past year's worth of logs and create a
> cumulative total, broken down by user and month.
> 
> I recently saw a perl regex that could do this, but it was too complex
> for me to follow.
> 
> Any suggestions, pointers, tips?  I really need this report fairly soon,
> unfortunately.
> 
> TIA
> 
> Jonathan Glass
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
> 
> !DSPAM:40a2ba0c320059123310096!
-- 
James P. Kinney III          \Changing the mobile computing world/
CEO & Director of Engineering \          one Linux user         /
Local Net Solutions,LLC        \           at a time.          /
770-493-8244                    \.___________________________./
http://www.localnetsolutions.com

GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics)
<jkinney at localnetsolutions.com>
Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part




More information about the Ale mailing list