Google Answers Logo
View Question
 
Q: Parsing a Generic Log File as an S-Expression ( No Answer,   0 Comments )
Question  
Subject: Parsing a Generic Log File as an S-Expression
Category: Computers > Programming
Asked by: padmapani-ga
List Price: $2.50
Posted: 12 Oct 2004 12:14 PDT
Expires: 13 Oct 2004 15:28 PDT
Question ID: 413803
I am looking for a code that will read a generic log file (say strace
output,syslog,etc) and convert each line into an S-expression
preferably in C/Perl.

The user provides the delimiter (default is a space) and we tokenize a
given line of input in the logfile based on it and store it as one
S-Expression.

Let me know if I was unclear in asking this question.

Request for Question Clarification by mathtalk-ga on 12 Oct 2004 16:58 PDT
Hi, padmapani-ga:

Perhaps the only unclearness is in my understanding, but if the input
line is tokenized, one possible S-expression that could be formed is a
simple parenthesized list of those tokens.

I'd guess that you expect something more, but I'll await your
clarification of the requirements.

regards, mathtalk-ga

Clarification of Question by padmapani-ga on 12 Oct 2004 19:18 PDT
Yes.You are right.I forgot to add the constraint that we need to match
a particular "text" given by the user with the requisite attributes.

For example consider the log file of the format

<time_stamp> <freq> <Event> <counter> <misc>

Say I only wanna collect <time_stamp> and <Event> or any such
arbitrary combination to produce the output
----------
(time_stamp       Event)

This should be fairly trivial too but next comes the toughest part

Similarly for a row like data consider
---------
StartRead(1,2);
InterruptsOff();
CacheHit();
CallFunction(Test);
StopRead(1,2)
InterruptsOn();
--------------

Now I wanna get a S-Expression that captures all events happening
between StartRead and StopRead with the output
---------
( begin (StartRead (1,2)) (InterruptsOff) (CacheHit)
(CallFunction(Test)) (StopRead (1,2))

I apologise for not letting you know this before.

Glad to Talk to you again MathTalk...

-Paddy
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy