-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix tags type to []interface{} in event (#5389) #5395
Conversation
Can one of the admins verify this patch? |
Maybe we should support both
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just changing []string
to []interface{}
unfortunately won't be enough. We need to support both, as the internal tags from config files are correctly parsed as []string
.
The type-switch use-case from your comment is definitely better. With some cleanup it becomes:
In addition one can change this event normalization/parsing code to also handle the Please add a Changlog entry when you are done. As this fixes an issue with filebeat, having a filebeat system test would be nice to have. Check for tests/system/test_json.py. |
@urso I updated the pr, please review again. Thanks! |
Sorry I didn't notice your comments, will update again. |
Hi @urso , I didn't find a way to run the system test |
system tests are run via nosetest. You can setup the python environment from within the filebeat directory via
head over to |
filebeat/tests/system/test_json.py
Outdated
@@ -367,3 +390,4 @@ def test_integer_condition(self): | |||
output = self.read_output() | |||
assert len(output) == 1 | |||
assert output[0]["status"] == 404 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, but the linter might complain about a newline at the end of the file.
proc.check_kill_and_wait() | ||
|
||
output = self.read_output()[0] | ||
assert sorted(output["tags"]) == ["tag1", "tag2", "tag3", "tag4"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
PR looks good to me. Thanks for taking the time!!! Also the filebeat system test are much appreciated! Unfortunately there is a conflict in the changelog file (github sometimes has problem with the changelog). Please rebase and check git not introducing any more errors (e.g. wrong changelog entries). This should also restart the tests, which have not been executed at all :( |
Support append tags to both []string and []interface{} Add system test and CHANGELOG
@urso I have to say I didn't get it passed on my mac... Because I always got a error |
I see. you can build No idea why files are owned by root user. Did you run via docker? Try |
I checked CI and your tests did pass. It's some flaky kafka tests in metricbeat that have failed. Will merge PR. Thanks for taking to time fix the issue. |
Closes #5389 @urso Could you please review this? 😄