HAProxy LoadBalancer Content Pack

The following content pack is available for use with a Graylog Illuminate license and Graylog Enterprise or Graylog Security. Contact sales to learn more about obtaining Illuminate.

HAProxy is an open-source software solution that provides a high-performance and highly available TCP and HTTP load balancer and proxy server. This technology pack will process HAProxy logs, providing normalization and enrichment of common events of interest.

Supported Version(s)

  • Tested with HAProxy version 2.9

Requirements

  • Logging via syslog (RFC 5424 format recommended) or Filebeat with Graylog Sidecar.

  • HAProxy HTTP/TCP server on a Linux system.

  • A syslog or Beats input configured in Graylog matching the IP, port, and protocol for log reception.

Stream Configuration

This technology pack includes 1 stream:

  • "Illuminate:HAProxy LoadBalancer Messages"

Hint: If this stream does not exist prior to the activation of this pack then it will be created and configured to route messages to this stream and the associated index set. There should not be any stream rules configured for this stream.

Index Set Configuration

This technology pack includes 1 index set definition:

  • "HAProxy LoadBalancer Messages"

Hint: If this index set is already defined, then nothing will be changed. If this index set does not exist, then it will be created with retention settings of a daily rotation and 90 days of retention. These settings can be adjusted as required after installation.

Log Collection

HAProxy supports the following log delivery methods:

  • Syslog (RFC 5424 format recommended)

  • Filebeat with Graylog Sidecar

Syslog Configuration

Configure HAProxy to send logs via syslog to your Graylog server.

  1. Create a Syslog input in Graylog matching the IP, port, and protocol for log reception.

  2. Configure HAProxy to send logs to the Graylog syslog input. Refer to the official HAProxy logging documentation for configuration details.

Filebeat with Graylog Sidecar

Please use the official Graylog Sidecar documentation to configure your Graylog server and your client(s).

  1. Create a Beats input in Graylog.

  2. Install Graylog Sidecar on the HAProxy host.

  3. Configure Filebeat to collect HAProxy log files and forward them to the Graylog Beats input.

Log Format Examples

HAProxy supports multiple log formats depending on the proxy mode configuration.

Connection Log (Default)

haproxy[1234]: Connect from 10.0.1.2:33312 to 10.0.3.31:8012 (www/HTTP)

Error Log

haproxy[6103]: 127.0.0.1:56059 [03/Dec/2023:17:35:10.380] frt/f1: Connection error during SSL handshake

TCP Log

haproxy[14387]: 10.0.1.2:33313 [06/Feb/2023:12:12:51.443] fnt bck/srv1 0/0/5007 212 -- 0/0/0/0/3 0/0

HTTP Log

haproxy[14329]: 10.0.1.2:33317 [06/Feb/2023:12:14:14.655] http-in static/srv1 10/0/30/69/109 200 2750 - - ---- 1/2/3/4/5 6/7 {graylog.eu} {} "GET /index.html HTTP/1.1"

HTTPS Log

haproxy[1234]: 10.0.1.2:36317 [06/Feb/2023:12:14:14.655] https-in static/srv1 10/0/30/69/109 200 2750 - - ---- 1/2/3/4/5 6/7 {graylog.eu} {} "GET /index.html HTTP/1.1" 0/0/0/0/0 graylog.eu/TLSv1.3/TLS_AES_256_GCM_SHA384

What is Provided

  • Parsing rules to extract HAProxy logs into Graylog schema-compatible fields.

  • GIM code 180200 (http communication) for HTTP/HTTPS proxy logs.

  • GIM code 120000 (network connection) for TCP proxy logs and default connection logs.

  • Event action detection from HAProxy termination state codes (allowed/blocked).

  • Event severity mapping from syslog priority levels.

  • Termination reason enrichment from HAProxy termination state codes.

  • HAProxy Spotlight dashboards.

GIM Categorization

GIM categorization is provided for the following log types:

Log Type gim_event_type_code gim_event_category gim_event_subcategory gim_event_type
HTTP/HTTPS proxy logs 180200 http http.communication http communication
TCP proxy logs 120000 network network.network connection network connection
Default connection logs 120000 network network.network connection network connection

Message Fields Included in This Pack

General Parsing

Connection (Default) Logs

Default Fields for TCP/HTTP and HTTPS Logs

TCP Logs

HTTP/HTTPS Logs

Error Logs

HAProxy LoadBalancer Spotlight

The HAProxy Spotlight offers dashboards with five tabs:

Overview

Default Logs

TCP Logs

HTTP/HTTPS Logs

Error Dashboard