Logo Search packages:      
Sourcecode: fail2ban version File versions  Download package

def logreader::logreader::LogReader::findFailure (   self,
  line 
)

Finds the failure in line. Uses the failregex pattern
      to find it and timeregex in order to find the logging
      time.
      
      Returns a dict with IP and timestamp.

Definition at line 162 of file logreader.py.

00162                                  :
            """ Finds the failure in line. Uses the failregex pattern
                  to find it and timeregex in order to find the logging
                  time.
                  
                  Returns a dict with IP and timestamp.
            """
            failList = list()
            match = re.search(self.failregex, line)
            if match:
                  timeMatch = re.search(self.timeregex, match.string)
                  if timeMatch:
                        date = self.getUnixTime(timeMatch.group())
                        ipMatch = textToIp(match.string)
                        if ipMatch:
                              for ip in ipMatch:
                                    failList.append([ip, date])
            return failList
      
      def hasTime(self, line):


Generated by  Doxygen 1.6.0   Back to index