Skip to content
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

Problems when ingesting logs with "time" field. #395

Open
jakobsvenning opened this issue May 7, 2020 · 2 comments
Open

Problems when ingesting logs with "time" field. #395

jakobsvenning opened this issue May 7, 2020 · 2 comments

Comments

@jakobsvenning
Copy link

I have encountered a problem when trying to ingest logs with the "time" field specified. For instance, when I try to ingest the log specified in the code snippet below; nothing appears in Google Cloud Logger.

{"message":"some message...", "severity":"INFO", "time":"2020-05-07T08:58:24.222947063Z"}

However, if I run the following ruby snippet to extract the second and nano second component from the timestamp from the log above:

require 'time'
t = "2020-05-07T08:58:24.222947063Z"
puts Time.iso8601(t).tv_nsec
puts Time.iso8601(t).tv_sec

and supply the second and nanosecond component that I received from the above snippet like in the log below, then the log is getting ingested properly.

{"message":"Hello there2","severity":"INFO", "timestamp": { "seconds": 1588841904, "nanos": 222947063}}

I have had a look at the source code and I cannot understand why one works but not the other.

All help is appreciated, Thanks!

@lambcode
Copy link

I am encountering the same issue. I put some rudimentary debug logs in the ruby code for the plugin and found that the "time" field is missing from the record when the plugin executes.

@bborysenko
Copy link

It looks like a similar issue fluent/fluentd#1833. I was able to resolve the problem just by setting the keep_time_key flag to true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants