> -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
>
>
>> 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
>> 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
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