JP Vossen on 6 Dec 2007 18:42:18 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Eating Crow with OOO


Date: Thu, 6 Dec 2007 11:18:17 -0500
From: Art Alexion <art.alexion@verizon.net>

OK, after defending this product, I can't get it to do something it seems I have been able to do with every other spreadsheet or "desktop database".

I am trying to import a fixed length log file into a database or spreadsheet, so I can group and sort by certain data columns. For the life of me, I can't figure out how to do it in Calc or Base. I just want a simple log viewer.

Before I fire up the winbox,

1. Does anyone know how to do this with calc (import fixed length data into a sheet)?, or

Aaron's reply sounds like a winner for this...


Failing that, I covered this in the _bash Cookbook_ 13.16 Processing Fixed-length Records. It's actually pretty easy to use gawk or perl to convert them into tab delimited (or CSV I guess, but why bother?).

Perl is a bit easier to read and type than the gawk solution:

See http://perldoc.perl.org/functions/pack.html for the "template" codes, but here A18 is a 'space padded ASCII string' 18 chars wide. And so forth.

# The following is all on one line:
$ perl -ne 'print join("\t", unpack("A18 A32 A16", $_) ) . "\n";' fixed-length_file

# Here's the same thing in gawk:
$ gawk ' BEGIN { FIELDWIDTHS = "18 32 16"; OFS = "\t" } { $1 = $1; gsub(/ +\t/, "\t"); gsub(/ +$/, ""); print }' fixed-length_file


2. Can someone suggest a configurable log viewer? This is not a unix log file, it is created by our proprietary spam filter, Xwall.

I'd be very interested in this as well, but have not been able to find one. A spreadsheet is an excellent and underused tool for log analysis, IMO. (Hummm, sounds like a preso; though I have written about this before [1].) They have lots of handy features like auto-filters, color coding (manual or conditional formats), sorting and much more. For another, the C-Level folks are all familiar and comfortable with spreadsheets, which can make log data less scary and more accessible to them when needed. That can be a big deal. But I regularly deal with log files > 65K rows, so OO.o Calc or Excel < 2007 don't cut it. "Use Access or Excel 2007" are not acceptable answers.

The "best" I've found is the Crippleware Kiwi Windows Log Viewing tool: http://www.kiwisyslog.com/log-viewer-info.php

My other solutions are to either cut the data into sections that fit or to remove and summarize the most frequent event, and try again, until the rest of the data fits.

HTH,
JP

[1] Spreadsheets as log analysis tools:
Sidebar in: http://www.jpsdomain.org/public/Scripting-Message_Triage_with_Perl_CSIJ-XX-3_Summer_2004.pdf
----------------------------|:::======|-------------------------------
JP Vossen, CISSP            |:::======|        jp{at}jpsdomain{dot}org
My Account, My Opinions     |=========|      http://www.jpsdomain.org/
----------------------------|=========|-------------------------------
Microsoft has single-handedly nullified Moore's Law.
Innate design flaws of Windows make a personal firewall, anti-virus
and anti-malware software mandatory. The resulting software arms race
has effectively flattened Moore's Law on hardware running Windows.
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug