-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle EventTime msgpack extension to handle nanosecond precision time and add its parameter #18
Conversation
With this fluent-cat with EventTime extention$ echo '{"current_version":"v0.14", "versions":{"unstable":0.14, "stable":0.12}}' | bundle exec fluent-cat my.logs logstash with this codeclogstash config w/ EventTime extension
Output result
Otherwise, logstash cannot handle subseconds: fluent-cat with EventTime ext$ echo '{"current_version":"v0.14", "versions":{"unstable":0.14, "stable":0.12}}' | bundle exec fluent-cat my.logs logstash with this codeclogstash config w/o EventTime extension
Output resultNothing output. |
How about these changes? |
# | ||
class LogStash::Codecs::Fluent < LogStash::Codecs::Base | ||
require "logstash/codecs/fluent/event_time" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to change this to require_relative "event_time"
to make it work on a new Logstash 6.2.2 setup otherwise you get {:exception=>#<LoadError: no such file to load -- logstash/codecs/fluent/event_time>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Umm..., in my environment, require_relative "event_time"
does not work. :'( require_relative "fluent/event_time"
and require "logstash/codecs/fluent/event_time"
work. 😖
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My plugin setup procedure is:
$ gem build logstash-codec-fluent.gemspec
$ logstash-plugin install logstash-codec-fluent-*.gem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I'll do another test tomorrow and I'll let you know.
Hi @cosmo0920 I've tested your patch in a brand new Logstash 6.2.2 setup with fluentd-bit v0.12.14 and it works 👍 This is the output from using the tail input.
Before this patch I wasn't getting anything in logstash and now I do. |
fluent-bit has fallback protocol mechanism.
|
Any news? |
I just tested this locally with logstash 7.3.0:
and
And confirmed sending data with nanosecond_precision enabled on both sides no longer fails. |
Oh, thank you. |
@cosmo0920 sorry for the long delay, and thank you for the work done here. [edit] very long delay. |
When will this be released? Currently hitting the issue resolved by this. |
when Fixnum | ||
fluent_time | ||
when EventTime | ||
Time.at(fluent_time.sec, fluent_time.nsec) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using the latest version of this plugin and are running into a problem, which in our opinion is caused by this line here. As far as I can see, calling Time.at
with just two parameters, expects the second parameter to specify microseconds and not nanoseconds, which in our case changed the timestamps and suddenly added roughly 10 minutes.
Shouldn't this read Time.at(fluent_time.sec, fluent_time.nsec / 1000.0)
instead?
Hi, I've tried to handle EventTime msgpack extension in this codec plugin.
How about start to handle EventTime extension?
Regards,