Here is a Perl script that I wrote to parse the log file into a csv file.
After converting to a logfile I import into a remedy form for analysis. The
original intent is for this script to be run from filter workflow and then have
the resulting csv file imported into a remedy form with the proper list field
definitions. Anyone here that wishes to work on and improve it, be my guest.
Dave Fincher
From: Action Request System discussion list(ARSList) [mailto:[EMAIL
PROTECTED] On Behalf Of Neel Guatam
Sent: Tuesday, July 10, 2007 11:05 AM
To: [email protected]
Subject: Re: Any tool/utility to work with filter logs?
** v\:* { BEHAVIOR: url(#default#VML) } o\:* { BEHAVIOR:
url(#default#VML) } w\:* { BEHAVIOR: url(#default#VML) } .shape {
BEHAVIOR: url(#default#VML) } st1\:* { BEHAVIOR: url(#default#ieooui)
} @font-face { font-family: Wingdings; } @font-face { font-family:
Book Antiqua; } @font-face { font-family: Tahoma; } @font-face {
font-family: Microsoft Sans Serif; } @font-face { font-family: Verdana; }
@font-face { font-family: sans-serif; } @page Section1 {size: 8.5in 11.0in;
margin: 1.0in .75in 1.0in .75in; } P.MsoNormal { FONT-SIZE: 12pt; MARGIN:
0in 0in 0pt; FONT-FAMILY: "Times New Roman" } LI.MsoNormal { FONT-SIZE:
12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman" } DIV.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman" } H1 {
FONT-WEIGHT: bold; FONT-SIZE: 14pt; MARGIN: 12pt 0in 3pt; FONT-FAMILY: "Book
Antiqua" } H2 { FONT-WEIGHT: bold; FONT-SIZE: 12pt; MARGIN:
12pt 0in 3pt; FONT-STYLE: italic; FONT-FAMILY: "Book Antiqua" } H3 {
FONT-WEIGHT: normal; FONT-SIZE: 12pt; MARGIN: 12pt 0in 3pt; FONT-FAMILY: "Book
Antiqua" } P.MsoHeader { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY:
"Times New Roman" } LI.MsoHeader { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt;
FONT-FAMILY: "Times New Roman" } DIV.MsoHeader { FONT-SIZE: 12pt; MARGIN:
0in 0in 0pt; FONT-FAMILY: "Times New Roman" } P.MsoFooter { FONT-SIZE:
12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman" } LI.MsoFooter {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman" }
DIV.MsoFooter { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New
Roman" } A:link { COLOR: blue; TEXT-DECORATION: underline }
SPAN.MsoHyperlink { COLOR: blue; TEXT-DECORATION: underline } A:visited {
COLOR: purple; TEXT-DECORATION: underline } SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline } P { FONT-SIZE: 12pt;
MARGIN-LEFT: 0in; MARGIN-RIGHT: 0in; FONT-FAMILY: "Times New Roman";
mso-margin-top-alt: auto; mso-margin-bottom-alt: auto } P.ABLOCKPARA {
FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Book Antiqua" }
LI.ABLOCKPARA { FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Book
Antiqua" } DIV.ABLOCKPARA { FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt;
FONT-FAMILY: "Book Antiqua" } P.ABULLET { FONT-SIZE: 11pt; MARGIN: 0in 0in
0pt 16.55pt; TEXT-INDENT: -16.55pt; FONT-FAMILY: "Book Antiqua" } LI.ABULLET
{ FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt 16.55pt; TEXT-INDENT: -16.55pt;
FONT-FAMILY: "Book Antiqua" } DIV.ABULLET { FONT-SIZE: 11pt; MARGIN: 0in
0in 0pt 16.55pt; TEXT-INDENT: -16.55pt; FONT-FAMILY: "Book Antiqua" }
P.AINDENTEDBULLET { FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt 33.1pt; TEXT-INDENT:
-16.55pt; FONT-FAMILY: "Book Antiqua" } LI.AINDENTEDBULLET { FONT-SIZE:
11pt; MARGIN: 0in 0in 0pt 33.1pt; TEXT-INDENT: -16.55pt; FONT-FAMILY: "Book
Antiqua" }
DIV.AINDENTEDBULLET { FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt 33.1pt;
TEXT-INDENT: -16.55pt; FONT-FAMILY: "Book Antiqua" } P.AINDENTEDPARA {
FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt 16.55pt; FONT-FAMILY: "Book Antiqua" }
LI.AINDENTEDPARA { FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt 16.55pt; FONT-FAMILY:
"Book Antiqua" } DIV.AINDENTEDPARA { FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt
16.55pt; FONT-FAMILY: "Book Antiqua" } SPAN.EmailStyle24 { COLOR: navy;
FONT-FAMILY: Arial; mso-style-type: personal-reply } DIV.Section1 { page:
Section1 } Server-side logs are uglier than client-side I guess but it
doesnt matter any tool/utility to read any type of log would be helpful.
Neel Gautam
Accenture - Chicago Delivery Centre
Office: 312-693-7279 Mobile: 630-440-6335
MSN: [EMAIL PROTECTED] AIM: neelgautam
Core Values:
Stewardship
·
Best People
·
Client Value Creation
·
One Global Network
·
Respect for the Individual
·
Integrity
---------------------------------
From: Action Request System discussion list(ARSList) [mailto:[EMAIL
PROTECTED] On Behalf Of John Atherly
Sent: Tuesday, July 10, 2007 10:42 AM
To: [email protected]
Subject: Re: Any tool/utility to work with filter logs?
**
What are you trying to read with in the logs? Server logs or client side
logging?
John Atherly
American Power Conversion
[EMAIL PROTECTED]
401-789-5735 Ext. 2120
1-800-788-2208 Ext. 2120
Neel Guatam <[EMAIL PROTECTED]>
Sent by: "Action Request System discussion list(ARSList)" <[email protected]>
07/10/2007 11:34 AM
Please respond to
[email protected]
To
[email protected]
cc
Subject
Any tool/utility to work with filter logs?
**
Hello fellow listers,
The filter/acl/esc logs are very tiresome to go through especially the filter
one due to the phasing. Is there any tool/utility/software to read these logs
transaction-wise? Theres got to be something out there L
Thanks in advance.
Neel Gautam
Accenture - Chicago Delivery Centre
Office: 312-693-7279 Mobile: 630-440-6335
MSN: [EMAIL PROTECTED] AIM: neelgautam
Core Values:
Stewardship
·
Best People
·
Client Value Creation
·
One Global Network
·
Respect for the Individual
·
Integrity
This message is for the designated recipient only and may contain privileged,
proprietary, or otherwise private information. If you have received it in
error, please notify the sender immediately and delete the original. Any other
use of the email by you is prohibited.
__20060125_______________________This posting was submitted with HTML in
it___
__20060125_______________________This posting was submitted with HTML in it___
This message is for the designated recipient only and may contain privileged,
proprietary, or otherwise private information. If you have received it in
error, please notify the sender immediately and delete the original. Any other
use of the email by you is prohibited.
__20060125_______________________This posting was submitted with HTML in it___
__20060125_______________________This posting was submitted with HTML in it___
---------------------------------
Got a little couch potato?
Check out fun summer activities for kids.
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the
Answers Are"#!/usr/bin/perl -w
# This Perl script reads and parses the log file created by the Filter or
Escalation action "Log to File".
# The script will read the generated log file and create a csv file which is
importable back into ARS or
# any other application which can read .csv files. This is useful if you need
to setup workflow to
# monitor data access or changes base on security requirements.
sub printerror() {
# prints error and usage instructions
print "\n";
print "ARSLog.pl [-?] [source] [destination]\n";
print "\n";
print " -? Displays help text.\n";
print " source Source log file to be converted.\n";
print " destination Destination CSV file to be writen.\n\n";
print " Note: ARS needs a CSV file for import. Your destination\n";
print " file should be a .csv file.\n";
exit 1;
}
foreach (@ARGV) {
# Determine if the -? help request option is included as an arguements
if ($_ eq '-?') {
printerror();
}
}
if (@ARGV < 2) {
# makes sure that the necessary number of arguements are given.
printerror();
exit;
}
# open the source file for processing
open(SOURCE, "$ARGV[0]") || die "Can not open $ARGV[0]: $!\n";
# open the destination file for processing
open(DESTINATION, ">$ARGV[1]") || die "Opening $ARGV[1]: $!\n";
# write the header information to the destination file
print DESTINATION "\"Timestamp\",\"Loginid\",\"Action\",\"Form\",\"Request
ID\",\"Data\"\n";
# read and parse each line in the source file
while(<SOURCE>) {
# Start parsing the input line to separate the data elements.
# Get Timestamp (timestamp ends with M)
($actiondate, $remaining) = split(/M /, $_);
$actiondate = $actiondate.'M';
# Get Login ID (30 Char, remove whitespace before and after)
$loginid = substr($remaining,0,30,);
$loginid =~ s/^\s+|\s+$//g;
# Get Action (1 Char)
$action=substr($remaining,31,1,);
# Get Form Name (254 Char, remove whitespace before and after)
$formname=substr($remaining,33,254,);
$formname =~ s/^\s+|\s+$//g;
$remaining=substr($remaining,288,,);
# Get Reqest ID (variable based on Request ID from ARS form split based on
whitespace)
($requestid)= split(/ /, $remaining);
$lenreqid = length($requestid)+1;
# Get Data Variable (variable based on data being writen to ARS form,
remove whitespace before and after).
$datastring = substr($remaining,$lenreqid);
$datastring =~ s/^\s+|\s+$//g;
#Print the data elements to the output file.
print DESTINATION
"\"$actiondate\",\"$loginid\",\"$action\",\"$formname\",\"$requestid\",\"$datastring\"\n";
}
# clean up open file handles
close(SOURCE);
close(DESTINATION);
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the
Answers Are"