コード例 #1
0
 def __doHourlySrcCount(self, foldername):
     files = batchFileReader(foldername, cookie=self.date)
     srcCounter = Counter()
     for line in files:
         srcIP = line.split("\t")[FieldToLoc["srcIP"]]
         srcCounter[srcIP] += 1
     return srcCounter
コード例 #2
0
def doDailySrcCount(foldername, date):
    files = batchFileReader(foldername, cookie=date)
    srcCounter = Counter()
    for line in files:
        srcIP = line.split("\t")[FieldToLoc["srcIP"]]
        srcCounter[srcIP] += 1
    return srcCounter
コード例 #3
0
 def __doHourlyTypeCount(
     self,
     folderType,
 ):
     files = batchFileReader(folderType, cookie=self.date)
     srcCounter = Counter()
     for line in files:
         type = line.split("\t")[FieldToLoc["type"]]
         srcCounter[type] += 1
     return srcCounter
コード例 #4
0
 def __doHourlyNameCount(
     self,
     foldername,
 ):
     files = batchFileReader(foldername, cookie=self.date)
     srcCounter = Counter()
     for line in files:
         name = line.split("\t")[FieldToLoc["query"]]
         srcCounter[name] += 1
     return srcCounter
コード例 #5
0
 def __doHourlyCount(self, foldername):
     files = batchFileReader(foldername, cookie=self.date)
     filterCounter = Counter()
     for line in files:
         if self.filterField is None or line.split("\t")[FieldToLoc[
                 self.filterField]] != self.filterVal:
             continue
         else:
             name = line.split("\t")[FieldToLoc[self.toField]]
             filterCounter[name] += 1
     return filterCounter