Configure the Log Retention

Each log stream in your pipeline is initially assigned a default data retention policy. However, you have the flexibility to define a custom retention policy for each log stream. The available options for retention periods include 7, 14, and 30 days.

By configuring the appropriate retention policy, you can determine how long the logs will be retained for each stream. The default retention period is set to 30 days.

However, within the log stream configuration, you have the flexibility to define a retention policy that aligns with your specific requirements. This allows you to determine how long the log data will be retained for a particular log stream.

You can use the following example:

curl -X "POST" "https://logging.de-txl.ionos.com/pipelines" \
     -H 'Content-Type: application/json' \
     -H 'Authorization: Bearer $TOKEN' \
     -d $'{
  "properties": {
    "name": "demo",
    "logs": [
      {
        "source": "kubernetes",
        "protocol": "http",
        "tag": "k8s",
        "destinations": [
          {
            "type": "loki",
            "retentionInDays": 5
          }
        ]
      }
    ]
  }
}'

You can also use the PATCH request to update the retention policy of an existing pipeline.

Last updated

Revision created on 9/7/2023