Skip to content

Instantly share code, notes, and snippets.

@dpetzel dpetzel/gist:5758291
Last active Dec 18, 2015

Embed
What would you like to do?
transform_example_text_capture
# Assume your Event was "MyCoolApp Tossed An Error"
import re
if getattr(evt, "datasourceId", None) is not None:
# Start with any characters up to the first space. Save the capture as variable named app_name
re_string = "^(?P<app_name>.*?)\s.*?"
m = re.search(re_string, evt.datasourceId)
if m and m.group('app_name'):
app_name = m.group('app_name')
# Now set the component equal to the app name
evt.component = app_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.