summaryrefslogtreecommitdiffstats
path: root/src/formats/haproxy_log.json
blob: 9795a19acf9ab26b524ad163d999df048d939cad (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
{
    "$schema": "https://lnav.org/schemas/format-v1.schema.json",
    "haproxy_log": {
        "title": "HAProxy HTTP Log Format",
        "description": "The HAProxy log format",
        "url": "http://www.haproxy.org/download/1.4/doc/configuration.txt",
        "regex": {
            "event_started": {
                "pattern": "(?<timestamp>\\w{3} \\d{2} \\d{2}:\\d{2}:\\d{2}) (?<logging_host>[^ ]+) (?<process_name>\\w+)\\[(?<pid>\\d+)\\]: Proxy (?<frontend_name>[^ ]+) started."
            },
            "event_stopping": {
                "pattern": "(?<timestamp>\\w{3} \\d{2} \\d{2}:\\d{2}:\\d{2}) (?<logging_host>[^ ]+) (?<process_name>\\w+)\\[(?<pid>\\d+)\\]: Stopping frontend (?<frontend_name>[^ ]+) in (?<stopping_timeout>\\d+) ms."
            },
            "event_stopped": {
                "pattern": "(?<timestamp>\\w{3} \\d{2} \\d{2}:\\d{2}:\\d{2}) (?<logging_host>[^ ]+) (?<process_name>\\w+)\\[(?<pid>\\d+)\\]: Proxy (?<frontend_name>[^ ]+) stopped \\(FE: (?<frontend_connections>\\d+) conns, BE: (?<backend_connections>\\d+) conns\\)."
            },
            "tcp": {
                "pattern": "(?<timestamp>\\w{3} \\d{2} \\d{2}:\\d{2}:\\d{2}) (?<logging_host>[^ ]+) (?<process_name>\\w+)\\[(?<pid>\\d+)\\]: (?<client_ip>[^:]+):(?<client_port>\\d+) \\[(?<accept_date>\\d{2}\\/\\w{3}\\/\\d{4}:\\d{2}:\\d{2}:\\d{2}.\\d{3})\\] (?<frontend_name>[^ ]+) (?<backend_name>[^ ]+)\\/(?<server_name>[^ ]+) (?<tw>\\d+)\\/(?<tc>\\d+)\\/(?<tt>\\d+) (?<bytes_read>\\d+) (?<termination_state>..) (?<actconn>\\d+)\\/(?<feconn>\\d+)\\/(?<beconn>\\d+)\\/(?<srv_conn>\\d+)\\/(?<retries>\\d+) (?<srv_queue>\\d+)\\/(?<backend_queue>\\d+)"
            },
            "http": {
                "pattern": "(?<timestamp>\\w{3} \\d{2} \\d{2}:\\d{2}:\\d{2}) (?<logging_host>[^ ]+) (?<process_name>\\w+)\\[(?<pid>\\d+)\\]: (?<client_ip>[^:]+):(?<client_port>\\d+) \\[(?<accept_date>\\d{2}\\/\\w{3}\\/\\d{4}:\\d{2}:\\d{2}:\\d{2}.\\d{3})\\] (?<frontend_name>[^ ]+)(?<ssl>~)? (?<backend_name>[^ ]+)\\/(?<server_name>[^ ]+) (?<tq>-?\\d+)\\/(?<tw>-?\\d+)\\/(?<tc>-?\\d+)\\/(?<tr>-?\\d+)\\/(?<tt>\\d+) (?<status_code>\\d{3}|-1) (?<bytes_read>\\d+) (?<captured_request_cookie>.*) (?<captured_response_cookie>.*) (?<termination_state>....) (?<actconn>\\d+)\\/(?<feconn>\\d+)\\/(?<beconn>\\d+)\\/(?<srv_conn>\\d+)\\/(?<retries>\\d+) (?<srv_queue>\\d+)\\/(?<backend_queue>\\d+) (?:\\{(?<captured_request_headers>.*)\\} \\{(?<captured_response_headers>.*)\\} )?\"(?<http_method>[A-Z<>]+)(?: (?<http_url>.*?))?(?: (?<http_version>HTTP\\/\\d+.\\d+))?\"?$"
            },
            "ssl": {
                "pattern": "(?<timestamp>\\w{3} \\d{2} \\d{2}:\\d{2}:\\d{2}) (?<logging_host>[^ ]+) (?<process_name>\\w+)\\[(?<pid>\\d+)\\]: (?<client_ip>[^:]+):(?<client_port>\\d+) \\[(?<accept_date>\\d{2}\\/\\w{3}\\/\\d{4}:\\d{2}:\\d{2}:\\d{2}.\\d{3})\\] (?<backend_name>[^ ]+)\\/(?<server_name>[^ ]+): (?<ssl_error>.+)$"
            }
        },
        "json": false,
        "value": {
            "stopping_timeout": {
                "kind": "integer"
            },
            "frontend_connections": {
                "kind": "integer"
            },
            "backend_connections": {
                "kind": "integer"
            },
            "logging_host": {
                "kind": "string"
            },
            "process_name": {
                "kind": "string"
            },
            "pid": {
                "kind": "integer",
                "foreign-key": true
            },
            "client_ip": {
                "kind": "string",
                "collate": "ipaddress"
            },
            "client_port": {
                "kind": "integer",
                "foreign-key": true
            },
            "accept_date": {
                "kind": "string"
            },
            "frontend_name": {
                "kind": "string",
                "identifier": true
            },
            "ssl": {
                "kind": "string"
            },
            "ssl_error": {
                "kind": "string"
            },
            "backend_name": {
                "kind": "string",
                "identifier": true
            },
            "server_name": {
                "kind": "string",
                "identifier": true
            },
            "tq": {
                "kind": "integer"
            },
            "tw": {
                "kind": "integer"
            },
            "tc": {
                "kind": "integer"
            },
            "tr": {
                "kind": "integer"
            },
            "tt": {
                "kind": "integer"
            },
            "status_code": {
                "kind": "integer",
                "identifier": true
            },
            "bytes_read": {
                "kind": "integer"
            },
            "captured_request_cookie": {
                "kind": "string"
            },
            "captured_response_cookie": {
                "kind": "string"
            },
            "termination_state": {
                "kind": "string"
            },
            "actconn": {
                "kind": "integer",
                "foreign-key": true
            },
            "feconn": {
                "kind": "integer",
                "foreign-key": true
            },
            "beconn": {
                "kind": "integer",
                "foreign-key": true
            },
            "srv_conn": {
                "kind": "integer",
                "foreign-key": true
            },
            "retries": {
                "kind": "integer"
            },
            "srv_queue": {
                "kind": "integer",
                "foreign-key": true
            },
            "backend_queue": {
                "kind": "integer",
                "foreign-key": true
            },
            "captured_request_headers": {
                "kind": "string"
            },
            "captured_response_headers": {
                "kind": "string"
            },
            "http_method": {
                "kind": "string",
                "identifier": true
            },
            "http_url": {
                "kind": "string"
            },
            "http_version": {
                "kind": "string"
            }
        },
        "sample": [
            {
                "line": "Feb 26 10:07:24 192.168.8.2 haproxy[1]: Proxy prod_http_in started."
            },
            {
                "line": "Feb 26 10:00:47 192.168.8.2 haproxy[7]: Stopping frontend prod_http_in in 0 ms."
            },
            {
                "line": "Feb 26 10:00:47 192.168.8.2 haproxy[7]: Proxy prod_http_in stopped (FE: 847876 conns, BE: 0 conns)."
            },
            {
                "line": "Feb 26 23:08:47 192.168.8.2 haproxy[7]: 178.203.144.192:50210 [26/Feb/2019:23:08:47.266] prod_http_in/slsp: Connection closed during SSL handshake"
            },
            {
                "line": "Feb 26 23:16:16 192.168.8.2 haproxy[7]: 178.203.144.192:50210 [26/Feb/2019:23:16:15.321] prod_ssh_in prod_ssh_out/ssh1 1/1/861 1485 -- 2/1/0/0/0 0/0"
            },
            {
                "line": "Feb 26 00:29:44 192.168.8.2 haproxy[7]: 178.203.144.192:50210 [26/Feb/2019:00:29:44.326] prod_http_in~ prod_http_out/nginx1 0/0/1/48/49 200 3313 - - ---- 3/2/0/0/0 0/0 {Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0} {} \"POST /schulportal/?Script=934&lehrer=126537&anm=3235&onlinetest=admin HTTP/1.1\""
            }
        ]
    }
}