-
Notifications
You must be signed in to change notification settings - Fork 33
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
The Logstash Ruby plugin documentation is incomplete. #7
Comments
Dang - 6 months later and I still cannot find a simple description of the event variable! |
same problem troubled me too. My problem is specific as below. |
I found this issue looking for the same info about the |
Ooh, was tearing my hair out trying to figure out where any documentation on the ruby filter API was. Had to rely on issues like #21 to figure out how to set fields. That Event API documentation is really useful, but it'd be nice if it were linked from the Ruby filter docs. The great thing is that the docs are open source, so I'll submit a PR to add a link. The thing that's a bit unfortunate is that I'm still on 2.x so the docs there actually aren't relevant to my version, but I'm working on upgrading to 5 soon... Edit: Hooray, my PR was accepted! #34 I still think more documentation would be helpful but that should at least get people on the right track. In particular, I'd like to know if i can do things like define functions, classes, etc. I'm guessing you probably can, but the examples given are quite short. |
One other question to answer here: you can indeed define methods inside the filter. The filter is basically being evaluated inside the body of a lambda; see: https://github.com/logstash-plugins/logstash-filter-ruby/blob/master/lib/logstash/filters/ruby.rb#L38 And apparently you can define methods in a lambda block. So it works, not sure whether there are any efficiency/overhead concerns.
Just kidding again, that was a typo in my own code. |
(This issue was originally filed by @dbeckham at elastic/logstash#2227)
The Ruby plugin documentation is incomplete and only documents the basic configuration option details.
Specifically, the code configuration option is the most important part of the configuration options, but it is one of the least documented options.
Issues:
event
variable is, or even what type of variable it is. We can assume it's some sort of hash or object based on the single example, but other than that, there are no details. What attributes or methods are available? Is it immutable? Can you alter the contents of other fields?A simple link to the description of the event variable, or a wider range of examples may help solve several of these issues.
The text was updated successfully, but these errors were encountered: