Esempio n. 1
0
 def ParseTime(self, match, **_):
     """Parse the log timestamp."""
     # TODO: do something with match.group(3) ?
     try:
         number_of_seconds = int(match.group(1), 10)
         timestamp = timelib.Timestamp.FromPosixTime(number_of_seconds)
         timestamp += int(match.group(2), 10) * 1000
         self.timestamp = timestamp
     except ValueError as exception:
         logging.error(
             u'Unable to retrieve timestamp with error: {0:s}'.format(
                 exception))
         self.timestamp = 0
         raise lexer.ParseError(u'Not a valid timestamp.')
Esempio n. 2
0
 def ParseFailed(self, **unused_kwargs):
     """Entry parsing failed callback."""
     raise lexer.ParseError(u'Unable to parse SELinux log line.')