logstash errors on timestamp format

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
User avatar
mike4vr
Posts: 89
Joined: Wed Feb 04, 2015 2:23 pm

logstash errors on timestamp format

Post by mike4vr »

We keep seeing massive amounts of errors in the logstash log complaining about the timestamp format:

Code: Select all

{:timestamp=>"2016-03-04T10:45:56.256000-0800", :message=>"Failed parsing date from field", :field=>"timestamp", :value=>"Mar  4 10:45:56", :exception=>java.lang.IllegalArgumentException: Invalid format: "Mar  4 10:45:56", :level=>:warn}
I'm guessing this is apache errors. Looking at our filter configuration, I have the following:

Code: Select all

if [program] == 'apache_access' {
    grok {
        match => [ 'message', '%{COMBINEDAPACHELOG}']
    }
    date {
        match => [ 'timestamp', 'dd/MMM/yyyy:HH:mm:ss Z' ]
    }
    mutate {
        replace => [ 'type', 'apache_access' ]
         convert => [ 'bytes', 'integer' ]
         convert => [ 'response', 'integer' ]
    }
}
 
if [program] == 'apache_error' {
    grok {
        match => [ 'message', '\[(?<timestamp>%{DAY:day} %{MONTH:month} %{MONTHDAY} %{TIME} %{YEAR})\] \[%{WORD:class}\] \[%{WORD:originator} %{IP:clientip}\] %{GREEDYDATA:errmsg}']
    }
    mutate {
        replace => [ 'type', 'apache_error' ]
    }
}
To me, the timestamp *looks* correct, but I am not totally sure. Is there a way to verify this? Or am I totally off?
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: logstash errors on timestamp format

Post by hsmith »

What kind of input is it? If it's coming in as a 'syslog' input, it may need to be changed.
Former Nagios Employee.
me.
User avatar
mike4vr
Posts: 89
Joined: Wed Feb 04, 2015 2:23 pm

Re: logstash errors on timestamp format

Post by mike4vr »

hsmith wrote:What kind of input is it? If it's coming in as a 'syslog' input, it may need to be changed.
Good question, how do I find out what kind of input it is? The above error I pasted is exactly what I see scrolling through logstash.log
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: logstash errors on timestamp format

Post by hsmith »

Would you be interested in doing a remote for this on Monday? If so, please send in a ticket to [email protected]. I'll take ownership of the ticket and give you my link to sign up for a remote. I feel like it may be quicker to resolve over remote than going back and forth on here.
Former Nagios Employee.
me.
User avatar
mike4vr
Posts: 89
Joined: Wed Feb 04, 2015 2:23 pm

Re: logstash errors on timestamp format

Post by mike4vr »

hsmith wrote:Would you be interested in doing a remote for this on Monday? If so, please send in a ticket to [email protected]. I'll take ownership of the ticket and give you my link to sign up for a remote. I feel like it may be quicker to resolve over remote than going back and forth on here.
Sure, email sent. Thanks.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: logstash errors on timestamp format

Post by jolson »

Mike,

I see your ticket in our system - I'll close this thread out for now. Thanks!
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Locked