Skip to content

regex for http haproxy log when 503 NOSRV is not working #2

@eduardogr

Description

@eduardogr

When haproxy writes logs like:

PROCESS_NAME[PID]: CLIENT_ID:CLIENT_PORT [REQUEST_DATE] FRONTEND_NAME BACKEND_NAME/ -1/-1/-1/-1/0 STATUS_CODE BYTES_READ - - SC-- 0/0/0/0/0 0/0 {333.333.333.333:80} "HTTP_REQUEST"

The regex:
/^(?<time>[^ ]*\s*[^ ]* [^ ]*) (?<ps>\w+)\[(?<pid>\d+)\]: ((?<c_ip>[\w\.]+):(?<c_port>\d+) \[(?<hatime>.+)\] (?<f_end>[\w-]+)~ (?<b_end>[\w-.]+)\/(?<b_server>[\w-]+) (?<tq>\d+)\/(?<tw>\d+)\/(?<tc>\d+)\/(?<tr>\d+)\/(?<tt>\d+) (?<status_code>\d+) (?<bytes>\d+) (?<req_cookie>\S+) (?<res_cookie>\S+) (?<t_state>[\w-]+) (?<actconn>\d+)\/(?<feconn>\d+)\/(?<beconn>\d+)\/(?<srv_conn>\d+)\/(?<retries>\d+) (?<srv_queue>\d+)\/(?<backend_queue>\d+) \{?(?<req_headers>[^}]*)\}? ?\{?(?<res_headers>[^}]*)\}? ?"(?<request>[^"]*)"|(?<message>.+))/

of the parse parser_haproxy.rb is not working

The point is to detect angular brackets <> for the NOSRV 503 status code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions