Logs: add backward compatibility (#5522)

This commit is contained in:
kulikov-a 2022-01-30 16:05:28 +03:00 committed by GitHub
parent 52d3e7c676
commit f530e4fb4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,7 +102,7 @@ if __name__ == '__main__':
'timestamp': None,
'parser': None,
'facility': 1,
'severity': 3,
'severity': None,
'process_name': '',
'pid': None,
'rnum': row_number
@ -124,7 +124,7 @@ if __name__ == '__main__':
record['parser'] = frmt.name
else:
record['line'] = rec['line']
if len(severity) == 0 or record['severity'] in severity:
if len(severity) == 0 or record['severity'] is None or record['severity'] in severity:
result['total_rows'] += 1
if (len(result['rows']) < limit or limit == 0) and result['total_rows'] >= offset:
result['rows'].append(record)