> For the complete documentation index, see [llms.txt](https://docs.groundcover.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.groundcover.com/reference/remote-access-and-apis/api-examples/update-logs-pipeline-configuration.md).

# Update Logs Pipeline Configuration

Replace the complete logs pipeline configuration.

### Authentication and permissions

Use an [API key](https://docs.groundcover.com/administer/api-keys.md) in `Authorization: Bearer <YOUR_API_KEY>` and select the backend with `X-Backend-Id: <YOUR_BACKEND_ID>`. Use your own API base URL for a self-hosted deployment.

**Admin permissions are required** to replace the logs pipeline configuration.

### Endpoint

**PUT** `/api/pipelines/logs/config`

### Request body

| Field   | Type   | Required | Description                                               |
| ------- | ------ | -------- | --------------------------------------------------------- |
| `value` | string | Yes      | The complete pipeline configuration as YAML or JSON text. |

The HTTP request body is JSON. Its `value` field is a string containing the configuration document; both YAML and JSON text are accepted.

A write replaces all configured rules. First [read the current configuration](https://docs.groundcover.com/reference/remote-access-and-apis/api-examples/get-logs-pipeline-configuration.md), save a backup, and include all rules you want to retain. Sending `ottlRules` directly at the top level is not the request format.

### Example

The following example requires `jq`. Save the configuration in `logs-pipeline.yaml`:

```bash
cat > logs-pipeline.yaml <<'YAML'
ottlRules:
  - ruleName: add_environment_tag
    statements:
      - set(attributes["environment"], "production")
YAML
```

This rule adds `environment: production` to each log's attributes. Adapt it to your environment and include any existing rules you want to keep.

Wrap the file contents in the JSON `value` field and send the request:

```bash
jq -n --rawfile value logs-pipeline.yaml '{value: $value}' | \
  curl --fail-with-body --request PUT \
    'https://api.groundcover.com/api/pipelines/logs/config' \
    --header 'Authorization: Bearer <YOUR_API_KEY>' \
    --header 'X-Backend-Id: <YOUR_BACKEND_ID>' \
    --header 'Content-Type: application/json' \
    --data-binary @-
```

`jq --rawfile` reads the complete file as a string and escapes newlines and quotes for JSON automatically. `--data-binary @-` sends that generated JSON from standard input. For a JSON configuration file, use `--rawfile value logs-pipeline.json` instead; `value` remains a string in either case.

### Response

HTTP 200 returns `uuid`, `created_by`, `created_timestamp`, and the saved `value`, as shown in [Get Logs Pipeline Configuration](https://docs.groundcover.com/reference/remote-access-and-apis/api-examples/get-logs-pipeline-configuration.md). POST to the same URL accepts the same body and returns HTTP 201. Both operations replace the whole configuration.

Invalid configuration or OTTL syntax returns HTTP 400. An unavailable configuration service can return HTTP 503.

See [Log Pipelines API](https://docs.groundcover.com/reference/remote-access-and-apis/api-examples/log-pipelines-api.md) to simulate a rule before saving it and inspect processing statistics afterwards.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.groundcover.com/reference/remote-access-and-apis/api-examples/update-logs-pipeline-configuration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
