An array of level can have an integer value & event ['tags'] can just be a value not always an array #5
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: