Modify the Log Retention Policy

Each log stream in your pipeline is initially assigned a default data retention policy of 30 days. The logs for each log stream are retained for the specified number of days. However, you can define a custom retention policy for each log stream. The available options for retention periods include 7, 14, and 30 days.

Note: You can alternatively use the PATCH request to update the retention policy of an existing pipeline.

The following is an example:

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

Last updated