Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #37500
| Date | 2013-01-23 14:08 -0600 |
|---|---|
| From | Tim Chase <python.list@tim.thechases.com> |
| Subject | Re: Search log for string and display hourly/daily report |
| References | <4f952e77-258d-47ae-9d76-a86daa8acaa2@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.918.1358971622.2939.python-list@python.org> (permalink) |
On 01/23/13 13:05, spek06@gmail.com wrote: > I need to search a log file for a specific string (Successfully > Sent) and report the number of instances in the last hour (from > when executed) and total for the day so far (midnight till the > time executed). Can anyone provide any examples of such a program > or get me started? You'd have to specify additional details on how the log-file is formatted, presumably how it's delimited, and what the format of the corresponding time-stamp is. Something like "I have a tab-delimited log file where the 4th column is the timestamp in the format 'YYYY-MM-DD HH:mm:ss' and the 18th column is the status. I want to search for items where the status contains 'Successfully Sent' and then further filter them by (1) events in the last hour, and (2) all events today" -tkc
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Search log for string and display hourly/daily report spek06@gmail.com - 2013-01-23 11:05 -0800
Re: Search log for string and display hourly/daily report Tim Chase <python.list@tim.thechases.com> - 2013-01-23 14:08 -0600
Re: Search log for string and display hourly/daily report John Gordon <gordon@panix.com> - 2013-01-23 21:25 +0000
Re: Search log for string and display hourly/daily report spek06@gmail.com - 2013-01-23 16:57 -0800
Re: Search log for string and display hourly/daily report Michael Torrie <torriem@gmail.com> - 2013-01-23 15:12 -0700
csiph-web