-
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
Empty condition in configuration crashes beats #7183
Comments
@adriansr oops, I will create a PR for that. |
Just a note here, using an empty processors:
- condition:
|
I can have a look if you want @ph |
@exekias I think it might be better you take a look, the thing that worries me as @adriansr stated is the beats/libbeat/processors/condition.go Lines 69 to 72 in 7abc684
By looking at the code path this seems to be the only possible way to return a nil condition, but by changing to return an error instead it breaks some unit test in the autodiscover module. |
When a
condition
from the configuration has no sub-fields,NewCondition
will return anil
condition. However, thisnil
condition will result in a panic when any of its methods is invoked.Use this broken config from the discuss thread above (note that the
equals
clause is wrongly indented at the same level ascondition
):will result in a panic:
Apart from NewCondition always returning an usable condition, we should try to warn the user or err on this configuration mistake
The text was updated successfully, but these errors were encountered: