added sane check for line lenght

This commit is contained in:
George Pochiscan 2023-05-26 12:24:19 +03:00
parent b3a43a96b1
commit c26de603bb

View File

@ -26,15 +26,17 @@ def parse_informix_transactions(info):
entry = {} entry = {}
parsed.setdefault(instance, []) parsed.setdefault(instance, [])
parsed[instance].append(entry) parsed[instance].append(entry)
if "C" in line[2]: ###in some cases, for some transaction lines there is no info, only a timestamp that should be ignored
entry.setdefault("current_log_id", line[3]) if len(line) > 2:
elif entry is not None: if "C" in line[2]:
if ":" in str(line[4]): entry.setdefault("current_log_id", line[3])
line[4] = line[4].split(":",1)[0] elif entry is not None:
if ":" in str(line[5]): if ":" in str(line[4]):
line[5] = line[5].split(":",1)[0] line[4] = line[4].split(":",1)[0]
if ":" in str(line[5]):
entry.setdefault("session", [line[2], line[3], line[4], line[5]]) line[5] = line[5].split(":",1)[0]
entry.setdefault("session", [line[2], line[3], line[4], line[5]])
return parsed return parsed
#############Transaction with more than 70 locks #############Transaction with more than 70 locks