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

BUG: Fix filter_func logging for config.debug=true #8456

Conversation

original-brownbear
Copy link
Member

Fixes this error reported by @ruflin :

logstash_1       | [2017-10-09T11:57:22,917][ERROR][logstash.pipeline        ] Exception in pipelineworker, the pipeline stopped processing new events, please check your filter configuration and restart Logstash. {:pipeline_id=>"main", "exception"=>"undefined method `to_hash' for [#<LogStash::Event:0x2122ce71>]:Array\nDid you mean?  to_h", "backtrace"=>["(eval):22:in `block in filter_func'", "/opt/logstash-7.0.0-alpha1-SNAPSHOT/logstash-core/lib/logstash/pipeline.rb:499:in `filter_batch'", "/opt/logstash-7.0.0-alpha1-SNAPSHOT/logstash-core/lib/logstash/pipeline.rb:478:in `worker_loop'", "/opt/logstash-7.0.0-alpha1-SNAPSHOT/logstash-core/lib/logstash/pipeline.rb:437:in `block in start_workers'"], :thread=>"#<Thread:0x6d57e27d sleep>"}

that resulted from events now being an [] for filter here as a result of #8428.

I know this isn't 100% perfect since we're now not logging each event before it hits the filter itself, but rather logging the whole batch before running the filter on it.
But the multi_filter method on FilterDelegator simply is what it is and works on batches instead of single events.

Copy link
Member

@jsvd jsvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested and confirmed patch makes the test pass

@original-brownbear
Copy link
Member Author

@jsvd thanks merging :)

@elasticsearch-bot
Copy link

Armin Braun merged this into the following branches!

Branch Commits
master b5062e7
6.x acad8ba

@elasticsearch-bot
Copy link

Armin Braun merged this into the following branches!

Branch Commits
6.0 550a6ea

elasticsearch-bot pushed a commit that referenced this pull request Oct 9, 2017
original-brownbear added a commit to original-brownbear/logstash that referenced this pull request Oct 9, 2017
original-brownbear added a commit to original-brownbear/logstash that referenced this pull request Oct 9, 2017
elasticsearch-bot pushed a commit that referenced this pull request Oct 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants