original_docstring: 
          Load event search definitions from yaml.
  
          An event is identified using between one and two expressions. If it
          requires a start and end to be considered complete then these can be
          specified for match otherwise we can match on a single line.
          Note that multi-line events can be overlapping hence why we don't use a
          SequenceSearchDef (we use common.analytics.LogEventStats).
          
docstring: Load event search definitions from yaml.
  An event is identified using between one and two expressions. If it
  requires a start and end to be considered complete then these can be
  specified for match otherwise we can match on a single line.
  Note that multi-line events can be overlapping hence why we don't use a
  SequenceSearchDef (we use common.analytics.LogEventStats).
docstring_tokens: Load event search definitions from yaml . An event is identified using between one and two expressions . If it requires a start and end to be considered complete then these can be specified for match otherwise we can match on a single line . Note that multi - line events can be overlapping hence why we don ' t use a SequenceSearchDef ( we use common . analytics . LogEventStats ) .
code: def _load_event_definitions(self):
          """
          Load event search definitions from yaml.
  
          An event is identified using between one and two expressions. If it
          requires a start and end to be considered complete then these can be
          specified for match otherwise we can match on a single line.
          Note that multi-line events can be overlapping hence why we don't use a
          SequenceSearchDef (we use common.analytics.LogEventStats).
          """
          path = os.path.join(constants.PLUGIN_YAML_DEFS, "events.yaml")
          with open(path) as fd:
              yaml_defs = yaml.safe_load(fd.read())
  
          if not yaml_defs:
              return
  
          plugin = yaml_defs.get(constants.PLUGIN_NAME, {})
          groups = plugin.get(self._yaml_defs_group, {})
          for group_name, section in groups.items():
              global_datasource = section.get('path')
              if 'path' in section:
                  del section['path']
  
              for event_name in section:
                  event = section[event_name]
  
                  # if this is a multiline event (has a start and end), append
                  # this to the tag so that it can be used with
                  # common.analytics.LogEventStats.
                  if 'end' in event:
                      tag = "{}-start".format(event_name)
                      expr = event['start']['expr']
                      hint = event['start'].get('hint')
                  else:
                      tag = event_name
                      expr = event['expr']
                      hint = event.get('hint')
  
                  start = SearchDef(expr, tag=tag, hint=hint)
                  if 'end' in event:
                      tag = "{}-end".format(event_name)
                      hint = event['end'].get('hint')
                      end = SearchDef(event['end']['expr'], tag=tag, hint=hint)
                  else:
                      end = None
  
                  # allow low-level path to override section global path
                  datasource = event.get('path', global_datasource)
                  ds = os.path.join(constants.DATA_ROOT, datasource)
                  if (event.get('allow-all-logs', True) and
                          constants.USE_ALL_LOGS):
                      ds = "{}*".format(ds)
  
                  if group_name not in self._event_defs:
                      self._event_defs[group_name] = {}
  
                  if event_name not in self._event_defs[group_name]:
                      self._event_defs[group_name][event_name] = {}
  
                  e_def = {'searchdefs': [start], 'datasource': ds}
                  if end:
                      e_def['searchdefs'].append(end)
  
                  self._event_defs[group_name][event_name] = e_def
code_tokens: def _load_event_definitions ( self ) : path = os . path . join ( constants . PLUGIN_YAML_DEFS , "events.yaml" ) with open ( path ) as fd : yaml_defs = yaml . safe_load ( fd . read ( ) ) if not yaml_defs : return plugin = yaml_defs . get ( constants . PLUGIN_NAME , { } ) groups = plugin . get ( self . _yaml_defs_group , { } ) for group_name , section in groups . items ( ) : global_datasource = section . get ( 'path' ) if 'path' in section : del section [ 'path' ] for event_name in section : event = section [ event_name ] if 'end' in event : tag = "{}-start" . format ( event_name ) expr = event [ 'start' ] [ 'expr' ] hint = event [ 'start' ] . get ( 'hint' ) else : tag = event_name expr = event [ 'expr' ] hint = event . get ( 'hint' ) start = SearchDef ( expr , tag = tag , hint = hint ) if 'end' in event : tag = "{}-end" . format ( event_name ) hint = event [ 'end' ] . get ( 'hint' ) end = SearchDef ( event [ 'end' ] [ 'expr' ] , tag = tag , hint = hint ) else : end = None datasource = event . get ( 'path' , global_datasource ) ds = os . path . join ( constants . DATA_ROOT , datasource ) if ( event . get ( 'allow-all-logs' , True ) and constants . USE_ALL_LOGS ) : ds = "{}*" . format ( ds ) if group_name not in self . _event_defs : self . _event_defs [ group_name ] = { } if event_name not in self . _event_defs [ group_name ] : self . _event_defs [ group_name ] [ event_name ] = { } e_def = { 'searchdefs' : [ start ] , 'datasource' : ds } if end : e_def [ 'searchdefs' ] . append ( end ) self . _event_defs [ group_name ] [ event_name ] = e_def
short_docstring: Load event search definitions from yaml.
short_docstring_tokens: Load event search definitions from yaml .
comment: """
          Load event search definitions from yaml.
  
          An event is identified using between one and two expressions. If it
          requires a start and end to be considered complete then these can be
          specified for match otherwise we can match on a single line.
          Note that multi-line events can be overlapping hence why we don't use a
          SequenceSearchDef (we use common.analytics.LogEventStats).
          """$SEP$# if this is a multiline event (has a start and end), append$SEP$# this to the tag so that it can be used with$SEP$# common.analytics.LogEventStats.$SEP$# allow low-level path to override section global path