Services: Web Proxy: Access Log - syslog parsing cleanup. closes https://github.com/opnsense/core/issues/6588

This commit is contained in:
Ad Schellevis 2023-06-01 08:33:42 +02:00
parent 962c388c58
commit 038d5b9bcf
1 changed files with 2 additions and 2 deletions

View File

@ -87,11 +87,11 @@ class SysLogFormatEpoch(NewBaseLogFormat):
@staticmethod
def match(line):
# 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
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
def line(self):