def main(self):
    """
    Takes a single log file as an argument (for now)
    """

    log = apachelogs.ApacheLogFile(self.logfile)
    myfilter = Filter(log, self.ruleset, self.process_date, self.process_url, self.process_qstring)

    if self.customOutput:
      for line in myfilter.strainer():
        self.outmod.munge(line)

    else:
      count = 0
      for line in myfilter.strainer():
        if self.fields:
          flist = []
          for field in self.fields:
             try:
               flist.append(getattr(line, field))
             except AttributeError as out:
                print "Line is missing field '%s'. That's odd. Typo in --return option maybe?" % str(field)
                return
          for item in flist:
             print item,
          print 
          continue
        if self.count:
          count +=1
        else:
          print line #line # note this line still has the apachelog attributes. You can 'print line.ip' instead if you want.

      if self.count:
        print "Matching lines: ", count
dataset/ETHPy150Open bkjones/loghetti/loghetti.py/loghetti.main/original