mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-25 23:55:56 +03:00
[GH-ISSUE #298] Logstash throws error with json codec due time format #98
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#98
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @saimaz on GitHub (Dec 29, 2013).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/298
Here's an error that logstash 1.3.2 throws using V1 LogstashFormatter:
Seems that logstash expects UTC timestamp without timezone, somethning like this:
2013-12-29T22:11:23.429Z@saimaz commented on GitHub (Dec 29, 2013):
The problem is because of joda parser format set in logstash.
github.com/logstash/logstash@d5ba312238/lib/logstash/time_addon.rb (L20)So logstash expects miliseconds with 3 digits.
@Seldaek commented on GitHub (Dec 30, 2013):
Could you report this on logstash's side too and link this issue? Because I'm thinking they probably want to be more liberal in what format they accept after the decimal if possible. More precision shouldn't hurt, and php's datetime only supports microseconds and not milliseconds so we would have to artificially trim the output.
@saimaz commented on GitHub (Dec 30, 2013):
Yes i already told them in IRC that on php there is no milliseconds, and i'm in trouble. And that format is probably for better performance.
Here's the ticket i have created in Jira: https://logstash.jira.com/browse/LOGSTASH-1738
I already have fixed this in my fork, but I don't know is that worth to open a pull request. IMO lets wait what logstash crew will say for this.
@Seldaek commented on GitHub (Dec 30, 2013):
OK cool then please keep this updated once you get news from them and we
will see what we do about it.
@saimaz commented on GitHub (Dec 30, 2013):
In Beaver (python): https://github.com/josegonzalez/beaver, they also got this problem.
https://github.com/josegonzalez/beaver/pull/230
@guillaumepotier commented on GitHub (Jan 2, 2014):
Very interested by this issue outcome, I also have problems now with the microsecond format :( Best
@aledelgo commented on GitHub (Jan 17, 2014):
same problem here, using the Monolog LogstashFormatter...
@saimaz commented on GitHub (Jan 24, 2014):
Logstash fixed time format issue in v1.3.3
@aledelgo commented on GitHub (Jan 24, 2014):
I don't think it's fixed. I still have the same problem:
Error: Invalid format: "2014-01-21T22:12:13+02:00" is malformed at "+02:00"
I have Logstash 1.3.3-1+debian installed via apt-get.
@Seldaek commented on GitHub (Feb 6, 2014):
@aledelgo maybe because you're missing the microseconds there?
@aledelgo commented on GitHub (Feb 6, 2014):
@Seldaek yes, it maybe, but this is a problem as on apache i have no way to set subseconds without faking it with a fixed .000 - actually i do so but then i have this error:
{:timestamp=>"2014-02-05T14:49:16.338000+0100", :message=>"Failed parsing date from field", :field=>"@timestamp", :value=>"2014-02-05T14:49:16.000+01:00", :exception=>#<TypeError: cannot convert instance of class org.jruby.RubyTime to class java.lang.String>, :level=>:warn}
@saimaz commented on GitHub (Feb 6, 2014):
you missing a colon in the time zone
@aledelgo commented on GitHub (Feb 6, 2014):
@saimaz
this is the malformed field: "2014-02-05T14:49:16.000+01:00" . where should i put a colon?
@saimaz commented on GitHub (Feb 6, 2014):
in the beginning of message i saw ":timestamp=>"2014-02-05T14:49:16.338000+0100", but this probably is created from java.
@aledelgo commented on GitHub (Feb 6, 2014):
yes that is the timestamp of the logstash log.
@saimaz commented on GitHub (Feb 6, 2014):
I have tested with both "2014-02-06T12:27:33.271+02:00" and "2014-02-06T12:29:46.134421+02:00", and it's working.
What configuration you are using?
@guillaumepotier commented on GitHub (Feb 6, 2014):
I confirm that with 1.3.3 Logstash last version everything is working fine for me.
@aledelgo commented on GitHub (Feb 6, 2014):
@saimaz
in my configuration i have
filter {
}
@aledelgo commented on GitHub (Feb 12, 2014):
It seems to be solved after i added this to the date filter:
"YYYY-MM-dd'T'H:mm:ss.SZZ"
but this is the "ISO8601" format that was already added to my filter...
ISO8601 details here:
http://www.w3.org/TR/NOTE-datetime
YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)
@momok2 commented on GitHub (Oct 1, 2014):
I have this Problem can some one help me ?
Failed parsing date from field {:field=>"message", :value=>"06 Sep 2014 00:03:35 is malformed at " Sep 2014 00:03:35,440 INFO
and that is my server time what i want to parse
@saimaz commented on GitHub (Oct 1, 2014):
This was due logstash, and they already fixed it. Please check if you have latest logstash version.
@momok2 commented on GitHub (Oct 1, 2014):
ok i have the latest version !!
but is not work so !!
@momok2 commented on GitHub (Oct 1, 2014):
can some one help me in this Problem
i have the latest version of Logstash !!