H,
Perl newb here....
I have an application log I'm trying to retrieve a specific sequence of 4 lines
from(event1, event2,event3, event4 - discarding any duplicates in between).
I've already filtered the log to get all occurances the four lines I want
but I don't know how to pull out the four lines when they happen sequentially.
EX:
09:12:50:861 EVENT1 #Don't want this line
09:13:09:467 EVENT1 #Don't want this line
09:13:09:837 EVENT1
09:13:38:059 EVENT2
09:14:03:115 EVENT3
09:14:04:076 EVENT4
09:14:11:376 EVENT1
09:14:34:049 EVENT2
09:14:34:990 EVENT3
09:14:34:990 EVENT3 #Don't want this line
09:14:34:990 EVENT4
I then need to do a time calculation between each of the four events (I can do this part....I just can't
figure out how to pull out the four lines I want everytime they appear in the sequential order I am looking for)
Can anyone help?
Thanks!
Original content restored by GrandFather. Replaced content was duplicate of Log Parsing Help
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.