Hello Monks!
I have a situation where I need to calculate the time between two events in a log file.
The log format is like this. Each login has a pair of events, invoke and success. The time of the event is in the second column. I need to correleate the events and report the time it took for them to complete. For extra credit, I will then look to generate 15 minute, 1 Hour and 3 Hour Averages for these events. If you know any way to accomplish this I would be forever grateful.
2013-08-09 13:00:23,784 DEBUG [SSHD] - invoke login agent [username=jo
+e]
2013-08-09 13:00:23,791 DEBUG [SSHD] - login agent success [username=j
+oe]
2013-08-09 13:10:29,025 DEBUG [SSHD] - invoke login agent [username=bo
+b]
2013-08-09 13:10:29,033 DEBUG [SSHD] - login agent success [username=b
+ob]
2013-08-09 13:20:19,841 DEBUG [SSHD] - invoke login agent [username=ja
+ne]
2013-08-09 13:20:19,848 DEBUG [SSHD] - login agent success [username=j
+ane]
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.