Skip to content
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

Merged
merged 1 commit into from
Oct 30, 2015

Conversation

JohnLZeller
Copy link
Contributor

Add config option for allowing the user to have events tagged by event_id of the form event_id:<num>.

@JohnLZeller
Copy link
Contributor Author

Tested on Windows Server 2012 and it works beautifully.

@JohnLZeller JohnLZeller added this to the 5.6.0 milestone Oct 28, 2015
@JohnLZeller
Copy link
Contributor Author

@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
Copy link
Member

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

@JohnLZeller
Copy link
Contributor Author

@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
Copy link
Member

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.

@degemer
Copy link
Member

degemer commented Oct 29, 2015

Two last small comments, but LGTM otherwise !

@JohnLZeller JohnLZeller force-pushed the zeller/win-event-id branch 2 times, most recently from 6553ab0 to 97bdbdc Compare October 29, 2015 15:18
JohnLZeller added a commit that referenced this pull request Oct 30, 2015
[win32_event_log] Allow optional tagging by event_id
@JohnLZeller JohnLZeller merged commit 0f15ec9 into master Oct 30, 2015
@JohnLZeller JohnLZeller deleted the zeller/win-event-id branch October 30, 2015 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants