-
Notifications
You must be signed in to change notification settings - Fork 814
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
[win32_event_log] Allow optional tagging by event_id #2009
Conversation
Tested on Windows Server 2012 and it works beautifully. |
@degemer since you last touched this check, would you mind giving me a quick r? :) |
# event sent from this check. Defaults to false. | ||
# tag_event_id: true | ||
|
||
tag_event_id: false |
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.
I think we kind of have an implicit convention that the default parameter should be commented, and nothing outside the comment, i.e. :
init_config:
# The (optional) tag_event_id setting will add an event id tag to each
# event sent from this check. Defaults to false.
# tag_event_id: false
d3180a8
to
03801af
Compare
@degemer fixed! All good now? |
@@ -150,13 +151,14 @@ def _convert_event_types(self, types): | |||
|
|||
|
|||
class LogEvent(object): | |||
def __init__(self, ev, api_key, hostname, tags, notify_list): | |||
def __init__(self, ev, api_key, hostname, tags, notify_list, tag_event_id): | |||
self.event = ev | |||
self.api_key = api_key | |||
self.hostname = hostname | |||
self.tags = tags |
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.
I might be missing something, but why not use something like self.tags = self._tags(tags, ev.EventCode) if tag_event_id else tags
?
This way you don't need to have a self.tag_event_id = tag_event_id
.
Two last small comments, but LGTM otherwise ! |
6553ab0
to
97bdbdc
Compare
97bdbdc
to
70263b8
Compare
[win32_event_log] Allow optional tagging by event_id
Add config option for allowing the user to have events tagged by event_id of the form
event_id:<num>
.