Example #1
0
	def __init__(self):
		Templates.__init__(self)
		# i60p295 sshd[12365]:
		template = PrefixTemplate()
		template.setRegex("\S+ \S+\[\d+\]:")
		self.templates.append(template)
		# [sshd] error: PAM:
		template = PrefixTemplate()
		template.setRegex("\[\S+\] \S+: \S+:")
		self.templates.append(template)
		# HOSTNAME courieresmtpd
		template = PrefixTemplate()
		template.setRegex("\S+ \S+:")
		self.templates.append(template)
Example #2
0
	def __init__(self):
		Templates.__init__(self)
		
		template = PrefixTemplate()
		template.setRegex("\S+ \S+\[\d+\]:")
		self.templates.append(template)
		
		template = PrefixTemplate()
		template.setRegex("\[\S+\] \S+: \S+:")
		self.templates.append(template)
		
		template = PrefixTemplate()
		template.setRegex("\S+ \S+:")
		self.templates.append(template)
 def __init__(self):
     Templates.__init__(self)
     # i60p295 sshd[12365]:
     template = PrefixTemplate()
     template.setRegex("\S+ \S+\[\d+\]:")
     self.templates.append(template)
     # [sshd] error: PAM:
     template = PrefixTemplate()
     template.setRegex("\[\S+\] \S+: \S+:")
     self.templates.append(template)
     # HOSTNAME courieresmtpd
     template = PrefixTemplate()
     template.setRegex("\S+ \S+:")
     self.templates.append(template)
 def __init__(self):
     Templates.__init__(self)
     # standard
     template = TimeStrptime()
     template.setDescription("Month Day Hour:Minute:Second")
     template.setRegex("\S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2}")
     template.setPattern("%b %d %H:%M:%S")
     self.templates.append(template)
     # asctime
     template = TimeStrptime()
     template.setDescription("Weekday Month Day Hour:Minute:Second Year")
     template.setRegex("\S{3} \S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2} \d{4}")
     template.setPattern("%a %b %d %H:%M:%S %Y")
     self.templates.append(template)
     # asctime without year
     template = TimeStrptime()
     template.setDescription("Weekday Month Day Hour:Minute:Second")
     template.setRegex("\S{3} \S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2}")
     template.setPattern("%a %b %d %H:%M:%S")
     self.templates.append(template)
     # simple date
     template = TimeStrptime()
     template.setDescription("Year/Month/Day Hour:Minute:Second")
     template.setRegex("\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}")
     template.setPattern("%Y/%m/%d %H:%M:%S")
     self.templates.append(template)
     # simple date too (from x11vnc)
     template = TimeStrptime()
     template.setDescription("Day/Month/Year Hour:Minute:Second")
     template.setRegex("\d{2}/\d{2}/\d{4} \d{2}:\d{2}:\d{2}")
     template.setPattern("%d/%m/%Y %H:%M:%S")
     self.templates.append(template)
     # Apache format [31/Oct/2006:09:22:55 -0000]
     template = TimeStrptime()
     template.setDescription("Day/Month/Year:Hour:Minute:Second")
     template.setRegex("\d{2}/\S{3}/\d{4}:\d{2}:\d{2}:\d{2}")
     template.setPattern("%d/%b/%Y:%H:%M:%S")
     self.templates.append(template)
     # Exim 2006-12-21 06:43:20
     template = TimeStrptime()
     template.setDescription("Year-Month-Day Hour:Minute:Second")
     template.setRegex("\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}")
     template.setPattern("%Y-%m-%d %H:%M:%S")
     self.templates.append(template)
     # named 26-Jul-2007 15:20:52.252
     template = TimeStrptime()
     template.setDescription(
         "Day-Month-Year Hour:Minute:Second[.Millisecond]")
     template.setRegex("\d{2}-\S{3}-\d{4} \d{2}:\d{2}:\d{2}")
     template.setPattern("%d-%b-%Y %H:%M:%S")
     self.templates.append(template)
     # TAI64N
     template = TimeTai64n()
     template.setDescription("TAI64N")
     self.templates.append(template)
     # Epoch
     template = TimeEpoch()
     template.setDescription("Epoch")
     self.templates.append(template)
     # ISO 8601
     template = TimeISO8601()
     template.setDescription("ISO 8601")
     self.templates.append(template)
Example #5
0
    def __init__(self):
        Templates.__init__(self)

        template = TimeStrptime()
        template.setDescription("Month Day Hour:Minute:Second")
        template.setRegex("\S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2}")
        template.setPattern("%b %d %H:%M:%S")
        self.templates.append(template)

        template = TimeStrptime()
        template.setDescription("Weekday Month Day Hour:Minute:Second Year")
        template.setRegex("\S{3} \S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2} \d{4}")
        template.setPattern("%a %b %d %H:%M:%S %Y")
        self.templates.append(template)

        template = TimeStrptime()
        template.setDescription("Weekday Month Day Hour:Minute:Second")
        template.setRegex("\S{3} \S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2}")
        template.setPattern("%a %b %d %H:%M:%S")
        self.templates.append(template)

        template = TimeStrptime()
        template.setDescription("Year/Month/Day Hour:Minute:Second")
        template.setRegex("\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}")
        template.setPattern("%Y/%m/%d %H:%M:%S")
        self.templates.append(template)

        template = TimeStrptime()
        template.setDescription("Day/Month/Year Hour:Minute:Second")
        template.setRegex("\d{2}/\d{2}/\d{4} \d{2}:\d{2}:\d{2}")
        template.setPattern("%d/%m/%Y %H:%M:%S")
        self.templates.append(template)

        template = TimeStrptime()
        template.setDescription("Day/Month/Year:Hour:Minute:Second")
        template.setRegex("\d{2}/\S{3}/\d{4}:\d{2}:\d{2}:\d{2}")
        template.setPattern("%d/%b/%Y:%H:%M:%S")
        self.templates.append(template)

        template = TimeStrptime()
        template.setDescription("Year-Month-Day Hour:Minute:Second")
        template.setRegex("\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}")
        template.setPattern("%Y-%m-%d %H:%M:%S")
        self.templates.append(template)

        template = TimeStrptime()
        template.setDescription("Day-Month-Year Hour:Minute:Second[.Millisecond]")
        template.setRegex("\d{2}-\S{3}-\d{4} \d{2}:\d{2}:\d{2}")
        template.setPattern("%d-%b-%Y %H:%M:%S")
        self.templates.append(template)

        template = TimeTai64n()
        template.setDescription("TAI64N")
        self.templates.append(template)

        template = TimeEpoch()
        template.setDescription("Epoch")
        self.templates.append(template)

        template = TimeISO8601()
        template.setDescription("ISO 8601")
        self.templates.append(template)
Example #6
0
def run_create_template(web, records):
  for i in range(len(records)):
      element = Element(records[i])
      element.website = web
      path = "../../synthetic_elements/" + web + "_synth.text"
      Templates.generate_text_match(element, path)
Example #7
0
	def __init__(self):
		Templates.__init__(self)
		# standard
		template = TimeStrptime()
		template.setDescription("Month Day Hour:Minute:Second")
		template.setRegex("\S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2}")
		template.setPattern("%b %d %H:%M:%S")
		self.templates.append(template)
		# asctime
		template = TimeStrptime()
		template.setDescription("Weekday Month Day Hour:Minute:Second Year")
		template.setRegex("\S{3} \S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2} \d{4}")
		template.setPattern("%a %b %d %H:%M:%S %Y")
		self.templates.append(template)
		# asctime without year
		template = TimeStrptime()
		template.setDescription("Weekday Month Day Hour:Minute:Second")
		template.setRegex("\S{3} \S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2}")
		template.setPattern("%a %b %d %H:%M:%S")
		self.templates.append(template)
		# simple date
		template = TimeStrptime()
		template.setDescription("Year/Month/Day Hour:Minute:Second")
		template.setRegex("\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}")
		template.setPattern("%Y/%m/%d %H:%M:%S")
		self.templates.append(template)
		# simple date too (from x11vnc)
		template = TimeStrptime()
		template.setDescription("Day/Month/Year Hour:Minute:Second")
		template.setRegex("\d{2}/\d{2}/\d{4} \d{2}:\d{2}:\d{2}")
		template.setPattern("%d/%m/%Y %H:%M:%S")
		self.templates.append(template)
		# Apache format [31/Oct/2006:09:22:55 -0000]
		template = TimeStrptime()
		template.setDescription("Day/Month/Year:Hour:Minute:Second")
		template.setRegex("\d{2}/\S{3}/\d{4}:\d{2}:\d{2}:\d{2}")
		template.setPattern("%d/%b/%Y:%H:%M:%S")
		self.templates.append(template)
		# Exim 2006-12-21 06:43:20
		template = TimeStrptime()
		template.setDescription("Year-Month-Day Hour:Minute:Second")
		template.setRegex("\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}")
		template.setPattern("%Y-%m-%d %H:%M:%S")
		self.templates.append(template)
		# named 26-Jul-2007 15:20:52.252 
		template = TimeStrptime()
		template.setDescription("Day-Month-Year Hour:Minute:Second[.Millisecond]")
		template.setRegex("\d{2}-\S{3}-\d{4} \d{2}:\d{2}:\d{2}")
		template.setPattern("%d-%b-%Y %H:%M:%S")
		self.templates.append(template)
		# TAI64N
		template = TimeTai64n()
		template.setDescription("TAI64N")
		self.templates.append(template)
		# Epoch
		template = TimeEpoch()
		template.setDescription("Epoch")
		self.templates.append(template)
		# ISO 8601
		template = TimeISO8601()
		template.setDescription("ISO 8601")
		self.templates.append(template)
Example #8
0
	def __init__(self):
		Templates.__init__(self)
		
		template = HostTemplate()
		template.setRegex("(?:::f{4,6}:)?(?P<%s>\S+)" % template.getName())
		self.templates.append(template)
Example #9
0
	def __init__(self):
		Templates.__init__(self)
		# ::ffff:141.3.81.106
		template = HostTemplate()
		template.setRegex("(?:::f{4,6}:)?(?P<%s>\S+)" % template.getName())
		self.templates.append(template)