Skip to content

Instantly share code, notes, and snippets.

@adampetrovic
Created September 28, 2015 01:55
Show Gist options
  • Save adampetrovic/7c87134c46b3db5b8e82 to your computer and use it in GitHub Desktop.
Save adampetrovic/7c87134c46b3db5b8e82 to your computer and use it in GitHub Desktop.
lnav haproxy format
{
"haproxy_http" : {
"title" : "HAProxy HTTP Log Format",
"description" : "The HAProxy log format for HTTP backends",
"url" : "http://www.haproxy.org/download/1.4/doc/configuration.txt",
"regex" : {
"std" : {
"pattern" : "^(?<timestamp>\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}) (?<logging_host>[^ ]+) (?<process_name>\\w+)\\[(?<pid>\\d+)]: (?<client_ip>[^:]+):(?<client_port>\\d+) \\[(?<accept_date>[^\\]]+)] (?<frontend_name>[^ ]+) (?<backend_name>[^ ]+)/(?<server_name>[^ ]+) (?<tq>\\d+)/(?<tw>\\d+)/(?<tc>\\d+)/(?<tr>\\d+)/(?<tt>\\d+) (?<status_code>\\d+) (?<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>.*)} (?<http_request>.*)$"
}
},
"json": false,
"value" : {
"logging_host" : {
"kind" : "string",
"identifier" : false
},
"process_name" : {
"kind" : "string",
"identifier" : false
},
"client_ip" : {
"kind" : "string",
"identifier" : false
},
"client_port" : {
"kind" : "integer",
"identifier" : false
},
"accept_date" : {
"kind" : "string",
"identifier" : false
},
"frontend_name" : {
"kind" : "string",
"identifier" : true
},
"backend_name" : {
"kind" : "string",
"identifier" : true
},
"server_name" : {
"kind" : "string",
"identifier" : true
},
"tq" : {
"kind" : "integer",
"identifier" : false
},
"tw" : {
"kind" : "integer",
"identifier" : false
},
"tc" : {
"kind" : "integer",
"identifier" : false
},
"tr" : {
"kind" : "integer",
"identifier" : false
},
"tt" : {
"kind" : "integer",
"identifier" : false
},
"status_code": {
"kind" : "integer",
"identifier" : true
},
"bytes_read": {
"kind" : "integer",
"identifier" : false
},
"captured_request_cookie": {
"kind" : "string",
"identifier" : false
},
"captured_response_cookie": {
"kind" : "string",
"identifier" : false
},
"termination_state": {
"kind" : "string",
"identifier" : false
},
"actconn" : {
"kind" : "integer",
"identifier" : false
},
"feconn" : {
"kind" : "integer",
"identifier" : false
},
"beconn": {
"kind" : "integer",
"identifier" : false
},
"srv_conn": {
"kind" : "integer",
"identifier" : false
},
"retries": {
"kind" : "integer",
"identifier" : false
},
"srv_queue": {
"kind" : "integer",
"identifier" : false
},
"backend_queue": {
"kind" : "integer",
"identifier" : false
},
"captured_request_headers": {
"kind" : "string",
"identifier" : false
},
"http_request": {
"kind" : "string",
"identifier" : false
}
},
"sample" : [
{
"line" : "2015-07-03T02:24:08+00:00 localhost haproxy[2704]: 172.26.22.18:33722 [03/Jul/2015:02:24:08.291] www.atlassian.com wac.internal.atlassian.com/wac-public-2.internal.atlassian.com 0/0/0/1/2 301 718 - - ---- 10/0/0/0/0 0/0 {123.127.186.254, 172.26.10.231, 172.26.26.14} \"GET /git?utm_source=bitbucket&utm_medium=link&utm_campaign=help_dropdown&utm_content=learn_git HTTP/1.1\""
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment