Services: Web Proxy: Access Log - syslog parsing cleanup. closes https://github.com/opnsense/core/issues/6588
This commit is contained in:
parent
962c388c58
commit
038d5b9bcf
|
@ -87,11 +87,11 @@ class SysLogFormatEpoch(NewBaseLogFormat):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def match(line):
|
def match(line):
|
||||||
# looks like an epoch
|
# looks like an epoch
|
||||||
return len(line) > 15 and line[0:10].isdigit() and line[10] == '.' and line[11:13].isdigit()
|
return len(line) > 15 and line[0:10].isdigit() and line[10] == '.' and line[11:14].isdigit()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def timestamp(self):
|
def timestamp(self):
|
||||||
return datetime.datetime.fromtimestamp(float(self._line[0:13])).isoformat()
|
return datetime.datetime.fromtimestamp(float(self._line[0:14])).isoformat(timespec='milliseconds')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def line(self):
|
def line(self):
|
||||||
|
|
Loading…
Reference in New Issue