Update ingest stream settings Technical Preview; added in 9.1.0

PUT /api/streams/{name}/_ingest

Spaces method and path for this operation:

put /s/{space_id}/api/streams/{name}/_ingest

Refer to Spaces for more information.

Upserts the ingest settings of an ingest stream definition

[Required authorization] Route required privileges: manage_stream.

Headers

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

Path parameters

  • name string Required
application/json

Body

PUT /api/streams/{name}/_ingest
curl \
 --request PUT 'https://localhost:5601/api/streams/{name}/_ingest' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --header "kbn-xsrf: true" \
 --data '"{\n  \"ingest\": {\n    \"failure_store\": {\n      \"inherit\": {}\n    },\n    \"lifecycle\": {\n      \"inherit\": {}\n    },\n    \"processing\": {\n      \"steps\": [\n        {\n          \"action\": \"grok\",\n          \"from\": \"message\",\n          \"ignore_missing\": false,\n          \"patterns\": [\n            \"%{IPORHOST:client.ip} %{USER:ident} %{USER:auth} \\\\[%{HTTPDATE:@timestamp}\\\\] \\\"%{WORD:http.method} %{DATA:url.original} HTTP/%{NUMBER:http.version}\\\" %{NUMBER:http.response.status_code:int} (?:%{NUMBER:http.response.body.bytes:int}|-)\"\n          ]\n        }\n      ]\n    },\n    \"settings\": {},\n    \"wired\": {\n      \"fields\": {\n        \"client.ip\": {\n          \"type\": \"ip\"\n        },\n        \"http.method\": {\n          \"type\": \"keyword\"\n        },\n        \"http.response.body.bytes\": {\n          \"type\": \"long\"\n        },\n        \"http.response.status_code\": {\n          \"type\": \"long\"\n        },\n        \"url.original\": {\n          \"type\": \"wildcard\"\n        }\n      },\n      \"routing\": [\n        {\n          \"destination\": \"logs.nginx.errors\",\n          \"status\": \"enabled\",\n          \"where\": {\n            \"eq\": \"500\",\n            \"field\": \"http.response.status_code\"\n          }\n        }\n      ]\n    }\n  }\n}"'
Request example
{
  "ingest": {
    "failure_store": {
      "inherit": {}
    },
    "lifecycle": {
      "inherit": {}
    },
    "processing": {
      "steps": [
        {
          "action": "grok",
          "from": "message",
          "ignore_missing": false,
          "patterns": [
            "%{IPORHOST:client.ip} %{USER:ident} %{USER:auth} \\[%{HTTPDATE:@timestamp}\\] \"%{WORD:http.method} %{DATA:url.original} HTTP/%{NUMBER:http.version}\" %{NUMBER:http.response.status_code:int} (?:%{NUMBER:http.response.body.bytes:int}|-)"
          ]
        }
      ]
    },
    "settings": {},
    "wired": {
      "fields": {
        "client.ip": {
          "type": "ip"
        },
        "http.method": {
          "type": "keyword"
        },
        "http.response.body.bytes": {
          "type": "long"
        },
        "http.response.status_code": {
          "type": "long"
        },
        "url.original": {
          "type": "wildcard"
        }
      },
      "routing": [
        {
          "destination": "logs.nginx.errors",
          "status": "enabled",
          "where": {
            "eq": "500",
            "field": "http.response.status_code"
          }
        }
      ]
    }
  }
}