Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ignore extra junk at the beginning of lines

Various logging systems may prepend extra info to each line. It's easy enough
  • Loading branch information...
commit ba795db7bad58ef784fe0970b434a2fe98eebb0c 1 parent 4c5598d
Douglas Rapp drapp authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 dex/dex.py
8 dex/dex.py
View
@@ -777,7 +777,7 @@ class StandardQueryHandler(QueryLineHandler):
########################################################################
def __init__(self):
self.name = 'Standard Query Log Line Handler'
- self._regex = '.{20}\[conn(?P<connection_id>\d+)\] '
+ self._regex = '.*\[conn(?P<connection_id>\d+)\] '
self._regex += '(?P<operation>\S+) (?P<ns>\S+\.\S+) query: '
self._regex += '(?P<query>\{.*\}) (?P<options>(\S+ )*)'
self._regex += '(?P<query_time>\d+)ms'
@@ -807,7 +807,7 @@ class CmdQueryHandler(QueryLineHandler):
########################################################################
def __init__(self):
self.name = 'CMD Log Line Handler'
- self._regex = '.{20}\[conn(?P<connection_id>\d+)\] '
+ self._regex = '.*\[conn(?P<connection_id>\d+)\] '
self._regex += 'command (?P<db>\S+)\.\$cmd command: '
self._regex += '(?P<query>\{.*\}) (?P<options>(\S+ )*)'
self._regex += '(?P<query_time>\d+)ms'
@@ -842,7 +842,7 @@ class UpdateQueryHandler(QueryLineHandler):
########################################################################
def __init__(self):
self.name = 'Update Log Line Handler'
- self._regex = '.{20}\[conn(?P<connection_id>\d+)\] '
+ self._regex = '.*\[conn(?P<connection_id>\d+)\] '
self._regex += 'update (?P<ns>\S+\.\S+) query: '
self._regex += '(?P<query>\{.*\}) update: (?P<update>\{.*\}) '
self._regex += '(?P<options>(\S+ )*)(?P<query_time>\d+)ms'
@@ -1027,4 +1027,4 @@ def construct_mapping(self, node, deep=False):
node.start_mark, 'found unacceptable key (%s)' % exc, key_node.start_mark)
value = self.construct_object(value_node, deep=deep)
mapping[key] = value
- return mapping
+ return mapping
Please sign in to comment.
Something went wrong with that request. Please try again.