summaryrefslogtreecommitdiffstats
path: root/test/formats/xmlmsg/format.json
blob: efd6f42b1c346be5d5ae41e51b2319d0d156f619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
    "$schema": "https://lnav.org/schemas/format-v1.schema.json",
    "xml_msg_log": {
        "title": "",
        "description": "",
        "regex": {
            "std": {
                "pattern": "^\\[(?<timestamp>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},\\d{3})\\]\\s+(?<level>\\w+)\\s+\\[(?<module>[^:]*):(?<line>\\d+)\\]\\s*(?<body>[^\\n]*)\\n?(?<msg_data>.*)"
            }
        },
        "level": {
            "critical": "CRITICAL",
            "error": "ERROR",
            "warning": "WARNING",
            "info": "INFO",
            "debug": "DEBUG"
        },
        "value": {
            "module": {
                "kind": "string",
                "identifier": true,
                "description": "Python source module which emitted log entry",
                "rewriter": ";SELECT ''"
            },
            "line": {
                "kind": "integer",
                "description": "Line number – in the module – where log entry was emitted"
            },
            "msg_data": {
                "kind": "xml",
                "rewriter": ";SELECT node_path FROM xpath('//*', :msg_data)"
            }
        },
        "highlights": {
            "client_id": {
                "pattern": "(?<=>)\\d+(?=<\/client>)",
                "color": "Orange1",
                "underline": true
            },
            "reply_error": {
                "pattern": "(?<=<result>)ERROR(?=</result>)",
                "color": "Red1"
            },
            "request": {
                "pattern": "<request[^>]*>",
                "color": "Green"
            },
            "reply": {
                "pattern": "<head[^>]*>",
                "color": "Gold1"
            }
        },
        "tags": {
            "xml-req": {
                "pattern": "Full request text:"
            }
        },
        "sample": [
            {
                "line": "[2020-12-10 06:56:41,477] INFO [m:108] Calling 'x' with params:",
                "level": "info"
            },
            {
                "line": "[2020-12-10 06:56:41,092] DEBUG [m:69] Full request text:\n<?xml version='1.0' encoding='iso-8859-2'?>\n<a-request>\n  <head>\n    x\n  </head>\n  <source>\n    x\n  </source>\n  <request>\n    <name>\n      x\n    </name>\n  </request>\n</a-request>\n",
                "level": "debug"
            },
            {
                "line": "[2020-12-10 06:56:41,099] DEBUG [m:85] Full reply text:\n<?xml version='1.0' encoding='iso-8859-2'?>\n<a-reply>\n  <head>\n    x\n  </head>\n  <reply>\n    <status>\n      <result>OK</result>\n    </status>\n    <name>\n      x\n    </name>\n  </reply>\n  <technical-track>\n    x\n  </technical-track>\n</a-reply>\n",
                "level": "debug"
            }
        ]
    }
}