예제 #1
0
	def addDefaultTemplate(self):
		self.__lock.acquire()
		try:
			# standard
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# asctime
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# asctime without year
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# simple date
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# simple date too (from x11vnc)
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# previous one but with year given by 2 digits
			# (See http://bugs.debian.org/537610)
			template = DateStrptime()
			template.setName("Day/Month/Year2 Hour:Minute:Second")
			template.setRegex("\d{2}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}")
			template.setPattern("%d/%m/%y %H:%M:%S")
			self._appendTemplate(template)
			# Apache format [31/Oct/2006:09:22:55 -0000]
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# CPanel 05/20/2008:01:57:39
			template = DateStrptime()
			template.setName("Month/Day/Year:Hour:Minute:Second")
			template.setRegex("\d{2}/\d{2}/\d{4}:\d{2}:\d{2}:\d{2}")
			template.setPattern("%m/%d/%Y:%H:%M:%S")
			self._appendTemplate(template)
			# Exim 2006-12-21 06:43:20
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# custom for syslog-ng 2006.12.21 06:43:20
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# named 26-Jul-2007 15:20:52.252 
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# 17-07-2008 17:23:25
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# 01-27-2012 16:22:44.252
			template = DateStrptime()
			template.setName("Month-Day-Year Hour:Minute:Second[.Millisecond]")
			template.setRegex("\d{2}-\d{2}-\d{4} \d{2}:\d{2}:\d{2}")
			template.setPattern("%m-%d-%Y %H:%M:%S")
			self._appendTemplate(template)
			# TAI64N
			template = DateTai64n()
			template.setName("TAI64N")
			self._appendTemplate(template)
			# Epoch
			template = DateEpoch()
			template.setName("Epoch")
			self._appendTemplate(template)
			# ISO 8601
			template = DateISO8601()
			template.setName("ISO 8601")
			self._appendTemplate(template)
			# Only time information in the log
			template = DateStrptime()
			template.setName("Hour:Minute:Second")
			template.setRegex("^\d{2}:\d{2}:\d{2}")
			template.setPattern("%H:%M:%S")
			self._appendTemplate(template)
			# <09/16/08@05:03:30>
			template = DateStrptime()
			template.setName("<Month/Day/Year@Hour:Minute:Second>")
			template.setRegex("^<\d{2}/\d{2}/\d{2}@\d{2}:\d{2}:\d{2}>")
			template.setPattern("<%m/%d/%y@%H:%M:%S>")
			self._appendTemplate(template)
			# MySQL: 130322 11:46:11
			template = DateStrptime()
			template.setName("YearMonthDay Hour:Minute:Second")
			template.setRegex("^\d{2}\d{2}\d{2} +\d{1,2}:\d{2}:\d{2}")
			template.setPattern("%y%m%d %H:%M:%S")
			self._appendTemplate(template)
			# ASSP: Apr-27-13 02:33:06
			template = DateStrptime()
			template.setName("Month-Day-Year Hour:Minute:Second")
			template.setRegex("^[a-zA-Z]{3}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}")
			template.setPattern("%b-%d-%y %H:%M:%S")
			self._appendTemplate(template)
			# UTC String (Node.js Express/Connect Logger): Wed, 31 Jul 2013 16:51:25 GMT
			template = DateStrptime()
			template.setName("WEEKDAY, Day MONTH Year Hour:Minute:Second")
			template.setRegex("\S{3}, \d{2} \S{3} \d{4} \d{2}:\d{2}:\d{2}")
			template.setPattern("%a, %d %b %Y %H:%M:%S")
			self._appendTemplate(template)
		finally:
			self.__lock.release()
예제 #2
0
	def addDefaultTemplate(self):
		self.__lock.acquire()
		try:
			if sys.version_info >= (2, 5): # because of '%.f'
				# asctime with subsecond
				template = DateStrptime()
				template.setName("WEEKDAY MONTH Day Hour:Minute:Second[.subsecond] Year")
				template.setRegex("\S{3} \S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2}\.\d+ \d{4}")
				template.setPattern("%a %b %d %H:%M:%S.%f %Y")
				self._appendTemplate(template)
			# asctime without no subsecond
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# asctime without year
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# standard - most loose from above 3 so by default follows after
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# simple date
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# simple date too (from x11vnc)
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# previous one but with year given by 2 digits
			# (See http://bugs.debian.org/537610)
			template = DateStrptime()
			template.setName("Day/Month/Year2 Hour:Minute:Second")
			template.setRegex("\d{2}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}")
			template.setPattern("%d/%m/%y %H:%M:%S")
			self._appendTemplate(template)
			# Apache format [31/Oct/2006:09:22:55 -0000]
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# CPanel 05/20/2008:01:57:39
			template = DateStrptime()
			template.setName("Month/Day/Year:Hour:Minute:Second")
			template.setRegex("\d{2}/\d{2}/\d{4}:\d{2}:\d{2}:\d{2}")
			template.setPattern("%m/%d/%Y:%H:%M:%S")
			self._appendTemplate(template)
			if sys.version_info >= (2, 5): # because of '%.f'
				# proftpd 2013-11-16 21:43:03,296
				# So like Exim below but with ,subsecond
				template = DateStrptime()
				template.setName("Year-Month-Day Hour:Minute:Second[,subsecond]")
				template.setRegex("\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d+")
				template.setPattern("%Y-%m-%d %H:%M:%S,%f")
				self._appendTemplate(template)
			# Exim 2006-12-21 06:43:20
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# custom for syslog-ng 2006.12.21 06:43:20
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# named 26-Jul-2007 15:20:52.252 
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# 17-07-2008 17:23:25
			template = DateStrptime()
			template.setName("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._appendTemplate(template)
			# 01-27-2012 16:22:44.252
			template = DateStrptime()
			template.setName("Month-Day-Year Hour:Minute:Second[.Millisecond]")
			template.setRegex("\d{2}-\d{2}-\d{4} \d{2}:\d{2}:\d{2}")
			template.setPattern("%m-%d-%Y %H:%M:%S")
			self._appendTemplate(template)
			# TAI64N
			template = DateTai64n()
			template.setName("TAI64N")
			self._appendTemplate(template)
			# Epoch
			template = DateEpoch()
			template.setName("Epoch")
			self._appendTemplate(template)
			# ISO 8601
			template = DateISO8601()
			template.setName("ISO 8601")
			self._appendTemplate(template)
			# Only time information in the log
			template = DateStrptime()
			template.setName("Hour:Minute:Second")
			template.setRegex("^\d{2}:\d{2}:\d{2}")
			template.setPattern("%H:%M:%S")
			self._appendTemplate(template)
			# <09/16/08@05:03:30>
			template = DateStrptime()
			template.setName("<Month/Day/Year@Hour:Minute:Second>")
			template.setRegex("^<\d{2}/\d{2}/\d{2}@\d{2}:\d{2}:\d{2}>")
			template.setPattern("<%m/%d/%y@%H:%M:%S>")
			self._appendTemplate(template)
			# MySQL: 130322 11:46:11
			template = DateStrptime()
			template.setName("YearMonthDay Hour:Minute:Second")
			template.setRegex("^\d{2}\d{2}\d{2} +\d{1,2}:\d{2}:\d{2}")
			template.setPattern("%y%m%d %H:%M:%S")
			self._appendTemplate(template)
			# ASSP: Apr-27-13 02:33:06
			template = DateStrptime()
			template.setName("Month-Day-Year Hour:Minute:Second")
			template.setRegex("^[a-zA-Z]{3}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}")
			template.setPattern("%b-%d-%y %H:%M:%S")
			self._appendTemplate(template)
		finally:
			self.__lock.release()
예제 #3
0
 def addDefaultTemplate(self):
     self.__lock.acquire()
     try:
         # standard
         template = DateStrptime()
         template.setName("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._appendTemplate(template)
         # asctime
         template = DateStrptime()
         template.setName("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._appendTemplate(template)
         # asctime without year
         template = DateStrptime()
         template.setName("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._appendTemplate(template)
         # simple date
         template = DateStrptime()
         template.setName("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._appendTemplate(template)
         # simple date too (from x11vnc)
         template = DateStrptime()
         template.setName("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._appendTemplate(template)
         # previous one but with year given by 2 digits
         # (See http://bugs.debian.org/537610)
         template = DateStrptime()
         template.setName("Day/Month/Year2 Hour:Minute:Second")
         template.setRegex("\d{2}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}")
         template.setPattern("%d/%m/%y %H:%M:%S")
         self._appendTemplate(template)
         # Apache format [31/Oct/2006:09:22:55 -0000]
         template = DateStrptime()
         template.setName("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._appendTemplate(template)
         # CPanel 05/20/2008:01:57:39
         template = DateStrptime()
         template.setName("Month/Day/Year:Hour:Minute:Second")
         template.setRegex("\d{2}/\d{2}/\d{4}:\d{2}:\d{2}:\d{2}")
         template.setPattern("%m/%d/%Y:%H:%M:%S")
         self._appendTemplate(template)
         # Exim 2006-12-21 06:43:20
         template = DateStrptime()
         template.setName("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._appendTemplate(template)
         # custom for syslog-ng 2006.12.21 06:43:20
         template = DateStrptime()
         template.setName("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._appendTemplate(template)
         # named 26-Jul-2007 15:20:52.252
         template = DateStrptime()
         template.setName("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._appendTemplate(template)
         # 17-07-2008 17:23:25
         template = DateStrptime()
         template.setName("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._appendTemplate(template)
         # 01-27-2012 16:22:44.252
         template = DateStrptime()
         template.setName("Month-Day-Year Hour:Minute:Second[.Millisecond]")
         template.setRegex("\d{2}-\d{2}-\d{4} \d{2}:\d{2}:\d{2}")
         template.setPattern("%m-%d-%Y %H:%M:%S")
         self._appendTemplate(template)
         # TAI64N
         template = DateTai64n()
         template.setName("TAI64N")
         self._appendTemplate(template)
         # Epoch
         template = DateEpoch()
         template.setName("Epoch")
         self._appendTemplate(template)
         # ISO 8601
         template = DateISO8601()
         template.setName("ISO 8601")
         self._appendTemplate(template)
         # Only time information in the log
         template = DateStrptime()
         template.setName("Hour:Minute:Second")
         template.setRegex("^\d{2}:\d{2}:\d{2}")
         template.setPattern("%H:%M:%S")
         self._appendTemplate(template)
         # <09/16/08@05:03:30>
         template = DateStrptime()
         template.setName("<Month/Day/Year@Hour:Minute:Second>")
         template.setRegex("^<\d{2}/\d{2}/\d{2}@\d{2}:\d{2}:\d{2}>")
         template.setPattern("<%m/%d/%y@%H:%M:%S>")
         self._appendTemplate(template)
         # MySQL: 130322 11:46:11
         template = DateStrptime()
         template.setName("MonthDayYear Hour:Minute:Second")
         template.setRegex("^\d{2}\d{2}\d{2} +\d{1,2}:\d{2}:\d{2}")
         template.setPattern("%y%m%d %H:%M:%S")
         self._appendTemplate(template)
         # ASSP: Apr-27-13 02:33:06
         template = DateStrptime()
         template.setName("Month-Day-Year Hour:Minute:Second")
         template.setRegex("^[a-zA-Z]{3}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}")
         template.setPattern("%b-%d-%y %H:%M:%S")
         self._appendTemplate(template)
     finally:
         self.__lock.release()
예제 #4
0
	def addDefaultTemplate(self):
		self.__lock.acquire()
		try:
			# standard
			template = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateTai64n()
			template.setName("TAI64N")
			self.__templates.append(template)
			# Epoch
			template = DateEpoch()
			template.setName("Epoch")
			self.__templates.append(template)
		finally:
			self.__lock.release()
예제 #5
0
	def addDefaultTemplate(self):
		self.__lock.acquire()
		try:
			
			template = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateTai64n()
			template.setName("TAI64N")
			self.__templates.append(template)
			
			template = DateEpoch()
			template.setName("Epoch")
			self.__templates.append(template)
		finally:
			self.__lock.release()
	def addDefaultTemplate(self):
		self.__lock.acquire()
		try:
			# standard
			template = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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)
			# CPanel 05/20/2008:01:57:39
			template = DateStrptime()
			template.setName("Month/Day/Year:Hour:Minute:Second")
			template.setRegex("\d{2}/\d{2}/\d{4}:\d{2}:\d{2}:\d{2}")
			template.setPattern("%m/%d/%Y:%H:%M:%S")
			self.__templates.append(template)
			# Exim 2006-12-21 06:43:20
			template = DateStrptime()
			template.setName("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 = DateStrptime()
			template.setName("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)
			# 17-07-2008 17:23:25
			template = DateStrptime()
			template.setName("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)
			# TAI64N
			template = DateTai64n()
			template.setName("TAI64N")
			self.__templates.append(template)
			# Epoch
			template = DateEpoch()
			template.setName("Epoch")
			self.__templates.append(template)
			# ISO 8601
			template = DateISO8601()
			template.setName("ISO 8601")
			self.__templates.append(template)
			# Only time information in the log
			template = DateStrptime()
			template.setName("Hour:Minute:Second")
			template.setRegex("^\d{2}:\d{2}:\d{2}")
			template.setPattern("%H:%M:%S")
			self.__templates.append(template)
			# <09/16/08@05:03:30>
			template = DateStrptime()
			template.setName("<Month/Day/Year@Hour:Minute:Second>")
			template.setRegex("^<\d{2}/\d{2}/\d{2}@\d{2}:\d{2}:\d{2}>")
			template.setPattern("<%m/%d/%y@%H:%M:%S>")
			self.__templates.append(template)
		finally:
			self.__lock.release()