# Log Security

The Logging Service is a versatile and accessible platform that allows you to conveniently store and manage logs from various sources. This platform offers a seamless log aggregation solution for logs generated within the IONOS Cloud infrastructure, by your bare metal system, or another cloud environment. With its flexibility, you can effortlessly push logs from anywhere, ensuring comprehensive log monitoring and analysis.

The following two encryption mechanisms safeguard all HTTP or TCP communications that push logs:

* Transport Layer Security (TLS)
* KEY
  * If using HTTP, then the `APIKEY` must be specified in the header.
  * If using TCP, specify the `Shared_Key`.

The key brings an extra layer of security with which you can revoke or regenerate the existing key.

## TCP (Fluent Bit)

When using TCP or TLS, you must enable `tls` and provide a `Shared_Key` in the Fluent Bit configuration. The key can be obtained through the REST API. For more information, see [<mark style="color:blue;">Obtain a new Key</mark>](https://docs.ionos.com/sections-test/guides/observability/logging-service/api-how-tos/obtain-key).

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

{% hint style="info" %}
**Note:** To view a complete list of parameters, see [<mark style="color:blue;">Fluent Bit's official website</mark>](https://docs.fluentbit.io/manual/pipeline/outputs/forward).
{% endhint %}

## HTTP (cURL)

If using HTTP (JSON), provide the key in the header as shown in the following example:

```bash
curl --location \ 
--request POST 'https://12be6dbe134f-logs.3b0b424eb27f.logging.de-txl.ionos.com/myhttp' \
--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"
}'
```

## HTTP (Fluent Bit)

This is an equivalent example of configuring Fluent Bit with HTTP outbound:

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

{% hint style="info" %}
**Note:** To view a complete list of parameters, see [<mark style="color:blue;">Fluent Bit's official website</mark>](https://docs.fluentbit.io/manual/pipeline/outputs/http).
{% endhint %}
