RE: convert date and time to epoch in awk

2013-02-19 Thread dteske
> -Original Message- > From: owner-freebsd-questi...@freebsd.org [mailto:owner-freebsd- > questi...@freebsd.org] On Behalf Of b w > Sent: Tuesday, February 19, 2013 2:34 PM > To: freebsd-questions@freebsd.org > Subject: convert date and time to epoch in awk > >

Re: convert date and time to epoch in awk

2013-02-19 Thread Karl Vogel
>> On Tue, 19 Feb 2013 23:34:21 +0100, >> b w said: b> I want to write a script that parses the last, say, 10 minutes of a log b> file looking for a certain string, like 'error', or failed', and returns b> how many times it shows up. The script would be run by Nagios and if it b> returns > 0 an

Re: convert date and time to epoch in awk

2013-02-19 Thread bw.mail.lists
>> So, is there a way to compare two dates in FreeBSD's awk or convert a date >> to epoch? Or some other fast way to select the last 10 minutes from a log >> file? An example would be appreciated, if possible. > > > Converting a date to an epoch is easy with date(1) (note: awk can make a sys

Re: convert date and time to epoch in awk

2013-02-19 Thread bw.mail.lists
b> I want to write a script that parses the last, say, 10 minutes of a log b> file looking for a certain string, like 'error', or failed', and returns b> how many times it shows up. The script would be run by Nagios and if it b> returns > 0 an alert is raised. Each line of the log file starts w