> For the complete documentation index, see [llms.txt](https://docs.bindplane.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bindplane.com/integrations/sources/haproxy.md).

# HAProxy

HAProxy is a high-performance TCP/HTTP load balancer and proxy. This source collects HAProxy logs by tailing the log files HAProxy writes (typically routed through syslog/rsyslog), and optionally parses each entry into structured fields.

### Supported Telemetry

| Platform | Metrics | Logs | Traces |
| -------- | ------- | ---- | ------ |
| Linux    |         | ✓    |        |
| Windows  |         | ✓    |        |
| macOS    |         | ✓    |        |

### Prerequisites

HAProxy logs through syslog, so logging must be configured before any file exists to tail:

* Configure HAProxy to emit logs. In the `global` section set a `log` target, and add `log global` to the `defaults`, `frontend`, `backend`, or `listen` sections. Add `option httplog` (HTTP mode) or `option tcplog` (TCP mode) for detailed request logging. See [Introduction to HAProxy Logging](https://www.haproxy.com/blog/introduction-to-haproxy-logging) and the [HAProxy Configuration Manual](https://docs.haproxy.org/2.2/configuration.html).
* Configure rsyslog (or your syslog daemon) to route those messages to a file on disk. The default path this source tails is `/var/log/haproxy/haproxy.log`; adjust **File Path(s)** to match wherever your syslog configuration writes HAProxy logs.
* The collector must run on a host that can read those log files. Ensure the collector's user has read permission on the configured paths.

### Configuration

<figure><img src="/files/33IOABwXYASM8Zp9Ss9C" alt="Bindplane docs - HAProxy - image 1"><figcaption></figcaption></figure>

**Logs**

| Parameter    | Type    | Required | Default                        | Description                  |
| ------------ | ------- | -------- | ------------------------------ | ---------------------------- |
| File Path(s) | Strings | No       | `/var/log/haproxy/haproxy.log` | File paths to tail for logs. |

**Advanced**

| Parameter | Type                   | Required | Default | Description                                   |
| --------- | ---------------------- | -------- | ------- | --------------------------------------------- |
| Timezone  | Timezone               | No       | `UTC`   | The timezone to use when parsing timestamps.  |
| Start At  | `Enum: beginning, end` | No       | `end`   | Start reading logs from `beginning` or `end`. |
| Parse     | Boolean                | No       | `true`  | Parses the log fields into structured data.   |

### Examples

#### Tail HAProxy logs from a custom path

This source tails a non-default HAProxy log path and reads existing log content from the beginning of the file on first start.

```yaml
apiVersion: bindplane.observiq.com/v1
kind: Source
metadata:
  name: haproxy
spec:
  type: haproxy
  parameters:
    - name: file_path
      value:
        - /var/log/haproxy/haproxy.log
    - name: start_at
      value: beginning
    - name: parse
      value: true
```

### Configuration Tips

* Set **Start At** to `beginning` when you need to backfill existing log content on first collection; leave it at `end` to ingest only new entries.
* Keep **Parse** enabled to extract structured fields from each log line. Disable it only if you intend to do all parsing downstream.
* Match **Timezone** to the timezone HAProxy/syslog writes timestamps in so parsed event times are correct.

### Troubleshooting

#### No logs are collected

**Symptom:** The source is running but no log records arrive.

**Solution:** Confirm HAProxy logging is actually enabled and that syslog/rsyslog is writing to a file. Verify the file exists at the configured **File Path(s)** and that the collector user can read it. If the file already contained data before collection started, set **Start At** to `beginning`.

#### Logs arrive but fields are not parsed

**Symptom:** Records are ingested as raw text without structured attributes.

**Solution:** Ensure **Parse** is enabled. Parsing expects HAProxy's standard log output; if HAProxy uses a heavily customized `log-format`, fields may not match the expected structure.

#### Timestamps are off by hours

**Symptom:** Parsed event timestamps are shifted from the actual time.

**Solution:** Set **Timezone** to the timezone in which HAProxy/syslog records its timestamps.

### Standalone Source

```yaml
apiVersion: bindplane.observiq.com/v1
kind: Source
metadata:
  name: haproxy
spec:
  type: haproxy
  parameters:
    - name: file_path
      value:
        - /var/log/haproxy/haproxy.log
    - name: start_at
      value: end
    - name: parse
      value: true
    - name: timezone
      value: UTC
```

### Related Resources

* [Introduction to HAProxy Logging](https://www.haproxy.com/blog/introduction-to-haproxy-logging) and the [HAProxy Configuration Manual](https://docs.haproxy.org/2.2/configuration.html)
* [OpenTelemetry filelog receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/filelogreceiver)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.bindplane.com/integrations/sources/haproxy.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
