Created
February 22, 2012 16:37
-
-
Save dpetzel/1885932 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
# Lets try and reduce noise here. Since services have multiple | |
# JMX data sources, we really don't need multiple events for each data source | |
# A single event should do the trick. We are going to normalize the summary | |
# so that dedupe rules kick in | |
re_string = "^DataSource\s(?P<app_name>.*?)\s.*?;\serror connecting to server" | |
if getattr(evt, "summary", "") != "": | |
m = re.search(re_string, evt.summary) | |
if m and m.group('app_name'): | |
new_summary = "".join([m.group('app_name'), " - ", | |
"Unable to establish JMX Connection" | |
]) | |
evt.summary = new_summary | |
#Additionally The eventKey, which is part of thed de-dupe hash | |
# contains the data point. Lets crush that as well for a better | |
# hit rate | |
evt.eventKey = m.group('app_name') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment