Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def decodeHitRow(row):
global G
vals = row.decode().split(SEPARATOR)
data = {}
data["site"] = vals[0]
data["path"] = vals[1]
data["method"] = vals[2]
data["ip"] = vals[3]
data["user_agent"] = vals[4]
data["is_authenticated"] = vals[5]
data["is_staff"] = vals[6]
data["is_superuser"] = vals[7]
data["user"] = vals[8]
data["referer"] = vals[9]
data["view"] = vals[10]
data["module"] = vals[11]
data["status_code"] = int(vals[12])
data["reason_phrase"] = vals[13]
data["request_time"] = int(vals[14])
def decodeEventRow(row):
row = row.decode("utf-8")
event = {}
for el in row.split(SEPARATOR):
t = el.split(":;")
k = t[0]
v = t[1]
event[k] = v
return event