> 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/sap-hana.md).

# SAP HANA

The SAP HANA source collects logs from an SAP HANA database. It reads the database's trace and diagnostic files from the collector host's filesystem, optionally parses each record into structured fields, and forwards them through your pipeline. Collection is file-based: the collector tails the configured trace file paths. No connection to the database is required.

### Supported Telemetry

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

### Prerequisites

* An SAP HANA database that is writing trace and diagnostic files to disk. By default these are written to `/usr/sap/<SID>/HDB<instance>/<host>/trace/` on the database host. See [Diagnostic Files and Logs](https://help.sap.com/docs/SAP_HANA_PLATFORM/6b94445c94ae495c83a19646e7c3fd56/335e2374c20245e78c9c4c6ce5b0fec6.html) in the SAP HANA Platform documentation. Configuring or enabling individual traces requires the `TRACE ADMIN` system privilege.
* A collector installed on the SAP HANA host (or a host with access to the trace files) with read permission on the configured log path(s). The trace directory and its files are typically owned by the `<sid>adm` operating-system user, so run the collector as a user that can read them.
* The trace file path(s) for your instance. The default `/usr/sap/*/HDB*/*/trace/*.trc` glob matches a standard single-tenant layout. Tenant databases write to a `DB_<database_name>` subdirectory, so adjust the path for multitenant systems.

### Configuration

<figure><img src="/files/M7iq7R2p4f89tZll986E" alt="Bindplane docs - SAP HANA - image 1"><figcaption></figcaption></figure>

**Logs**

| Parameter   | Type    | Required | Default                         | Description                                                                                                   |
| ----------- | ------- | -------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| Log Path(s) | Strings | Yes      | `/usr/sap/*/HDB*/*/trace/*.trc` | File paths to logs. Supports glob patterns. Add one or more paths to match the trace files for your instance. |

**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 the `beginning` or `end` of each file. Use `beginning` to ingest existing content on first run. |
| Parse     | Boolean              | No       | `true`  | Parses the log fields into structured data. When disabled, records are forwarded as raw lines.                          |

### Examples

#### Collect trace logs from a single-tenant instance

Read the default trace files, parse them into structured fields, and only ingest new entries written after the collector starts.

```yaml
apiVersion: bindplane.observiq.com/v1
kind: Source
metadata:
  name: sap-hana
spec:
  type: hana
  parameters:
    - name: file_path
      value:
        - /usr/sap/*/HDB*/*/trace/*.trc
    - name: start_at
      value: end
    - name: timezone
      value: UTC
    - name: parse
      value: true
```

#### Backfill existing logs from a tenant database

Point at a tenant database's trace subdirectory and read existing content from the beginning of each file.

```yaml
apiVersion: bindplane.observiq.com/v1
kind: Source
metadata:
  name: sap-hana
spec:
  type: hana
  parameters:
    - name: file_path
      value:
        - /usr/sap/PRD/HDB00/host01/trace/DB_TENANT1/*.trc
    - name: start_at
      value: beginning
    - name: parse
      value: true
```

### Configuration Tips

* The default path glob targets a standard single-tenant layout. For multitenant systems, add a path that includes the `DB_<database_name>` subdirectory for each tenant you want to collect.
* Leave Start At on `end` for steady-state collection to avoid re-ingesting historical files. Set it to `beginning` only for an initial backfill, then revert.
* Set Timezone to match the timezone the database host writes into its trace timestamps so parsed timestamps are accurate.

### Troubleshooting

#### No logs are collected

Symptoms: the source is configured but no log records flow.

Solutions:

1. Confirm the configured path(s) match real `.trc` files on the collector host. Verify the glob resolves to actual files for your SID, instance, and host.
2. Confirm the collector's operating-system user has read permission on the trace directory and files. They are typically owned by `<sid>adm`.
3. If you expect existing content, set Start At to `beginning`. With `end`, only new lines written after the collector starts are read.

#### Timestamps are off by hours

Symptoms: parsed log timestamps are shifted from the actual event time.

Solutions:

1. Set Timezone to the timezone the SAP HANA host uses when writing trace timestamps.
2. Confirm Parse is enabled. With Parse disabled, records are forwarded as raw lines and timestamps are not extracted.

### Standalone Source

```yaml
apiVersion: bindplane.observiq.com/v1
kind: Source
metadata:
  name: sap-hana
spec:
  type: hana
  parameters:
    - name: file_path
      value:
        - /usr/sap/*/HDB*/*/trace/*.trc
    - name: timezone
      value: UTC
    - name: start_at
      value: end
    - name: parse
      value: true
```

### Related Resources

* [SAP HANA Platform: Diagnostic Files and Logs](https://help.sap.com/docs/SAP_HANA_PLATFORM/6b94445c94ae495c83a19646e7c3fd56/335e2374c20245e78c9c4c6ce5b0fec6.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/sap-hana.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.
