# Send Logs to the Platform

You can send logs to the Logging Service using Fluent Bit. Based on your infrastructure—Kubernetes, Docker, Linux Systemd, or HTTP—the configuration differs.

{% hint style="info" %}
**Prerequisites:**

* A `Ready` pipeline instance. To obtain `tcpAddress` or `httpAddress`, see [<mark style="color:blue;">Set Up a Logging Pipeline</mark>](/cloud/observability/logging-service/api-how-tos/set-up-logging-pipeline-instance.md).
* A [<mark style="color:blue;">key</mark>](/cloud/observability/logging-service/api-how-tos/obtain-key.md) obtained from the REST API.
* Fluent Bit installed on your system. For more information, refer to the [<mark style="color:blue;">Getting Started with Fluent Bit Documentation</mark>](https://docs.fluentbit.io/manual/installation/getting-started-with-fluent-bit).
  {% endhint %}

{% stepper %}
{% step %}

### Obtain the pipeline endpoint

After creating a pipeline, the response includes either a `tcpAddress` or `httpAddress`. Save this value.

Example TCP endpoint:

`12be6dbe134f-logs.3b0b424eb27f.logging.de-txl.ionos.com`

Example `HTTP` endpoint:

`https://12be6dbe134f-logs.3b0b424eb27f.logging.de-txl.ionos.com`
{% endstep %}

{% step %}

### Obtain a key

Use the `Shared_Key` (TCP) or `APIKEY` (`HTTP`) returned when you created the pipeline for authentication. To generate a new key, see [<mark style="color:blue;">Obtain a new Key</mark>](/cloud/observability/logging-service/api-how-tos/obtain-key.md).
{% endstep %}
{% endstepper %}

## Configure Fluent Bit

Each log source requires the pipeline endpoint and a key.

{% tabs %}
{% tab title="Kubernetes" %}

1. Install the Fluent Bit package for your Kubernetes distribution. For more information, refer to the [<mark style="color:blue;">Fluent Bit on Kubernetes Documentation</mark>](https://docs.fluentbit.io/manual/installation/downloads/kubernetes).
2. Update the Fluent Bit configuration with the `tcpAddress` and `Shared_Key`.
3. Run Fluent Bit to forward logs to the Logging Service.

```ini
[OUTPUT]
    Name            forward
    Match           *
    Port            9000
    Tag             <TAG>
    Host            <TCP_ENDPOINT>
    tls             on
    Shared_Key      <KEY>
```

{% hint style="warning" %}
**Warning:** The port must be set to **9000** when using TCP.
{% endhint %}

{% hint style="info" %}
**Note:** For more information, refer to the [<mark style="color:blue;">Kubernetes configuration examples</mark>](https://github.com/ionos-cloud/observability-services-user-documentation/tree/main/logging/examples/kubernetes).
{% endhint %}
{% endtab %}

{% tab title="Docker" %}

1. Install the Fluent Bit package for Docker. For more information, refer to the [<mark style="color:blue;">Fluent Bit on Docker Documentation</mark>](https://docs.fluentbit.io/manual/installation/downloads/docker).
2. Update the Fluent Bit configuration with the `tcpAddress` and `Shared_Key`.
3. Run Fluent Bit to forward logs to the Logging Service.

```ini
[OUTPUT]
    Name            forward
    Match           *
    Port            9000
    Tag             <TAG>
    Host            <TCP_ENDPOINT>
    tls             on
    Shared_Key      <KEY>
```

{% hint style="warning" %}
**Warning:** The port must be set to **9000** when using TCP.
{% endhint %}

{% hint style="info" %}
**Note:** For more information, refer to the [<mark style="color:blue;">Docker configuration examples</mark>](https://github.com/ionos-cloud/observability-services-user-documentation/tree/main/logging/examples/docker).
{% endhint %}
{% endtab %}

{% tab title="Linux Systemd" %}

1. Install the appropriate Fluent Bit package for your Linux distribution. For more information, refer to the [<mark style="color:blue;">Getting Started with Fluent Bit Documentation</mark>](https://docs.fluentbit.io/manual/installation/getting-started-with-fluent-bit).
2. Update the Fluent Bit configuration with the `tcpAddress` and `Shared_Key`.
3. Run Fluent Bit to forward logs to the Logging Service.

```ini
[OUTPUT]
    Name            forward
    Match           *
    Port            9000
    Tag             <TAG>
    Host            <TCP_ENDPOINT>
    tls             on
    Shared_Key      <KEY>
```

{% hint style="warning" %}
**Warning:** The port must be set to **9000** when using TCP.
{% endhint %}

{% hint style="info" %}
**Note:** For more information, refer to the [<mark style="color:blue;">Linux Systemd configuration examples</mark>](https://github.com/ionos-cloud/observability-services-user-documentation/tree/main/logging/examples/systemd).
{% endhint %}
{% endtab %}

{% tab title="HTTP" %}
Send logs directly via the `HTTP` REST endpoint. Only JSON-formatted logs are supported.

```bash
curl --location \
--request POST 'https://<HTTP_ENDPOINT>/<TAG>' \
--header 'Content-Type: application/json' \
--header 'APIKEY: <KEY>' \
--data '{
    "status": "Ready",
    "ts": 1580306777.04728,
    "pod": {
        "name": "Example Name",
        "namespace": "data"
    },
    "msg": "Pod status updated",
    "level": "error",
    "label_1": "test label"
}'
```

Alternatively, configure Fluent Bit to use the `HTTP` output plugin:

```ini
[OUTPUT]
    Name            http
    Match           *
    Host            <HTTPS_ENDPOINT>
    URI             /<TAG>
    Format          json
    Header          APIKEY <KEY>
    tls             on
    Port            443
```

{% endtab %}
{% endtabs %}

## Troubleshooting

1. **Verify:** Open the Logging Service dashboard and confirm that logs appear.
2. **Invalid key:** Check that you copied the correct `Shared_Key` or `APIKEY`.
3. **Connection errors:** Verify outbound access on port **9000** (TCP) or port **443** (`HTTP`).
4. **No logs displayed:** Enable verbose logging in Fluent Bit:

```ini
[OUTPUT]
    Log_Level      debug
```

For more information, see [<mark style="color:blue;">Fluent Bit global configuration</mark>](https://docs.fluentbit.io/manual/administration/configuring-fluent-bit/classic-mode/configuration-file).


---

# Agent Instructions: 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:

```
GET https://docs.ionos.com/cloud/observability/logging-service/quick-start/send-logs-to-platform.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
