An array of level can have an integer value & event ['tags'] can just be a value not always an array - #5
Open
edefaria wants to merge 2 commits into
Open
An array of level can have an integer value & event ['tags'] can just be a value not always an array#5edefaria wants to merge 2 commits into
edefaria wants to merge 2 commits into
Conversation
… 2/A array of level can have an integer value 1/NoMethodError: undefined method `join' for "_grokparsefailure":String 2/NoMethodError: undefined method `downcase' for 6:Fixnum
Contributor
|
Code looks OK to me. Can you add test coverage for this change? |
|
Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then say 'jenkins, test it'. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found 2 issues:
1/An array of level can have an integer value, currently the code convert to string the level if it just have one value without an array, but when event['level'] is an array, in some rare case, it may crash like that (if integer value is present in the array)
It crashs with the following stack in debug:
2/event ['tags'] can just be a value not always an array
If you setup Logstash into Logstash. A first logstash server with output-gelf, setup grok filter which failed, so it generated tags => ["_grokparsefailure"]. The second logstash server with gelf-input and gelf-output. The event['tags'] has in this case an array of one value on the first logstash server and just a value without an array on the second server.
It crashs with the following stack in debug: