---
type: api
title: Create or update a Logstash pipeline
description: Create a centrally-managed Logstash pipeline or update a pipeline.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-put-logstash-pipeline
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-put-logstash-pipeline
products:
  - Kibana
---

# Create or update a Logstash pipeline

Availability: Preview

- Server: `https://{kibana_url}`

## Paths

- `PUT` `/api/logstash/pipeline/{id}`

#### Path parameters

- `id` (string) — required
  An identifier for the pipeline. Pipeline ID must begin with a letter or underscore and can contain only letters, underscores, dashes, hyphens, and numbers.

## Description

Create a centrally-managed Logstash pipeline or update a pipeline.
To use this API, you must have either the `logstash_admin` built-in role or a customized Logstash writer role.

[Secure your connection](https://www.elastic.co/guide/en/logstash/current/ls-security.html)

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Request body

`application/json`

- `description` (string) — optional
  A description of the pipeline.
- `pipeline` (string) — required
  A definition for the pipeline.
- `settings` (object) — optional
  Supported settings, represented as object keys, include the following:

- `pipeline.workers`
- `pipeline.batch.size`
- `pipeline.batch.delay`
- `pipeline.ecs_compatibility`
- `pipeline.ordered`
- `queue.type`
- `queue.max_bytes`
- `queue.checkpoint.writes`

## Response

Indicates a successful call

## Code examples

#### Console

```console
PUT kbn:/api/logstash/pipeline/ID
{
  "pipeline": "input { stdin {} } output { stdout {} }",
  "settings": {
    "queue.type": "persisted"
  }
}
```

#### curl

```curl
curl -X PUT "${KIBANA_URL}/api/logstash/pipeline/${ID}" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "pipeline": "input { stdin {} } output { stdout {} }",
    "settings": {
      "queue.type": "persisted"
    }
  }'
```

