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

RubyTime object is not Logstash::Timestamp #77

Closed
untergeek opened this issue Nov 4, 2015 · 7 comments
Closed

RubyTime object is not Logstash::Timestamp #77

untergeek opened this issue Nov 4, 2015 · 7 comments
Assignees
Labels

Comments

@untergeek
Copy link
Contributor

It appears that the JDBC plugin is grabbing timestamps correctly, but it's only converting them to RubyTime objects, which is not the same thing as a Logstash::Timestamp. This conversion should be possible without resorting to a ruby{} filter.

See: https://discuss.elastic.co/t/logstash-date-filter-question/33663

@untergeek
Copy link
Contributor Author

A temporary workaround:

ruby {
  code => "event['event_date'] = LogStash::Timestamp.new(event['event_date'])"
}

@CraigFoote
Copy link

Bad news Aaron, I'm getting an error with your workaround:

Ruby exception occurred: uninitialized constant Logstash::Filters::Ruby::Logstash {:level =>:error, :file=>"logstash/filters/ruby.rb", :line=>"41", :method=>"filter"}

@CraigFoote
Copy link

My apologies, I transcribed "LogStash::Timestamp.new" as "Logstash::Timestamp.new". When I capitalized the "S" your code worked. Thanks again.

@untergeek
Copy link
Contributor Author

Excellent! I'll close this now.

@CraigFoote
Copy link

I meant your workaround code works. The jdbc input plugin is still indexing date fields as strings.

@untergeek untergeek reopened this Nov 9, 2015
@untergeek
Copy link
Contributor Author

Right. Oops 😄

@suyograo
Copy link
Contributor

This has been fixed in #83

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

No branches or pull requests

5 participants