How to use the watchtower.conf.SEPARATOR function in watchtower

To help you get started, we’ve selected a few watchtower examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github synw / django-watchtower / watchtower / serializer.py View on Github external
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])
github synw / django-watchtower / watchtower / serializer.py View on Github external
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