original_docstring: 
      Parse the supervisord.log line into a dogstream event
      
docstring: Parse the supervisord.log line into a dogstream event
docstring_tokens: Parse the supervisord . log line into a dogstream event
code: def parse_supervisord(log, line):
      """
      Parse the supervisord.log line into a dogstream event
      """
      if len(line) == 0:
          log.info("Skipping empty line of supervisord.log")
          return None
      if log:
          log.debug('PARSE supervisord:%s' % line)
      line_items = line.split(' ', 3)
      timestamp = ' '.join(line_items[:2])
      timestamp_parts = timestamp.split(',')
      dt = datetime.strptime(timestamp_parts[0], "%Y-%m-%d %H:%M:%S")
      dt = dt.replace(microsecond=int(timestamp_parts[1]))
      date = time.mktime(dt.timetuple())
      event_type = line_items[2]
      msg = line_items[3]
      if event_type in SUPERVISORD_LEVELS:
          alert_type = ALERT_TYPES_MAPPING.get(event_type, 'info')
          if alert_type == 'info' and 'success' in msg:
              alert_type = 'success'
          event = dict(timestamp=date,
                       event_type=EVENT_TYPE,
                       alert_type=alert_type,
                       msg_title=msg.strip())
          program_result = program_matcher.match(msg)
          if program_result:
              event['event_object'] = program_result.groupdict()['program']
          if log:
              log.debug('RESULT supervisord:%s' % event)
          return [event]
      else:
          return None
code_tokens: def parse_supervisord ( log , line ) : if len ( line ) == 0 : log . info ( "Skipping empty line of supervisord.log" ) return None if log : log . debug ( 'PARSE supervisord:%s' % line ) line_items = line . split ( ' ' , 3 ) timestamp = ' ' . join ( line_items [ : 2 ] ) timestamp_parts = timestamp . split ( ',' ) dt = datetime . strptime ( timestamp_parts [ 0 ] , "%Y-%m-%d %H:%M:%S" ) dt = dt . replace ( microsecond = int ( timestamp_parts [ 1 ] ) ) date = time . mktime ( dt . timetuple ( ) ) event_type = line_items [ 2 ] msg = line_items [ 3 ] if event_type in SUPERVISORD_LEVELS : alert_type = ALERT_TYPES_MAPPING . get ( event_type , 'info' ) if alert_type == 'info' and 'success' in msg : alert_type = 'success' event = dict ( timestamp = date , event_type = EVENT_TYPE , alert_type = alert_type , msg_title = msg . strip ( ) ) program_result = program_matcher . match ( msg ) if program_result : event [ 'event_object' ] = program_result . groupdict ( ) [ 'program' ] if log : log . debug ( 'RESULT supervisord:%s' % event ) return [ event ] else : return None
short_docstring: Parse the supervisord.log line into a dogstream event
short_docstring_tokens: Parse the supervisord . log line into a dogstream event
comment: """
      Parse the supervisord.log line into a dogstream event
      """