bilpor
bilpor

Reputation: 3889

Error trying to simulate a pipeline

I'm trying to create a gsub pipeline, but before I do I'm trying to simulate it by following the many examples on the internet. Here's my code:

PUT _ingest/pipeline/removescript/_simulate
{
  "pipeline" :{
    "description": "remove script",
    "processors": [
      { "gsub" :{
        "field": "content",
        "pattern": "(?:..)[^<%]+[^%>](?:..)",
        "replacement": ""
        }
      }]
  },
  "docs": [
    {
      "_id": "tt",
      "_source": {
        "content": "leave <% remove me %> Me"
      }
    }]
}

However when I run it I receive the following error:

No handler found for uri [/_ingest/pipeline/removescript/_simulate] and method [PUT]

If I change the PUT line to be: PUT _ingest/pipeline/_simulate or PUT _ingest/pipeline/removescript

then I receive the following error:

{
  "error": {
    "root_cause": [
      {
        "type": "parse_exception",
        "reason": "[processors] required property is missing",
        "header": {
          "property_name": "processors"
        }
      }
    ],
    "type": "parse_exception",
    "reason": "[processors] required property is missing",
    "header": {
      "property_name": "processors"
    }
  },
  "status": 400
}

Upvotes: 0

Views: 1691

Answers (1)

Val
Val

Reputation: 217314

The _simulate endpoint works only with POST and not PUT:

POST _ingest/pipeline/removescript/_simulate
{
   ...
}

Upvotes: 5

Related Questions