Skip to content

ingest: Support multiple pipelines from _simulate without creating actual pipelines #35495

@jakelandis

Description

@jakelandis

In 6.5 the ingest node introduced the pipeline processor which allows one pipeline to call another pipeline. In order to call another pipeline, you need a named pipeline, a.k.a a real pipeline defined.

The _simulate API only supports a single nameless pipeline, which makes simulations against pipeline to pipeline calls awkward. For example, to use the ingest _simluate API with multiple pipelines, you must create real pipelines for the simulation. For example:

PUT _ingest/pipeline/pipeline1
{
  "processors": [
    {
      "set": {
        "field": "1",
        "value": "b"
      }
    },
    {
      "pipeline": {
        "name": "pipeline2"
      }
    }
  ]
}

PUT _ingest/pipeline/pipeline2
{
  "processors": [
        {
      "set": {
        "field": "2",
        "value": "c"
      }
    },
    {
      "pipeline": {
        "name": "pipeline3"
      }
    }
  ]
}

PUT _ingest/pipeline/pipeline3
{
  "processors": [
    {
      "set": {
        "field": "3",
        "value": "d"
      }
    }
  ]
}

POST _ingest/pipeline/pipeline1/_simulate?verbose
{
  "docs": [
    {
      "_source": {
        "0" : "a"
      }
    }
  ]
}

The above simulation works without issue, however:

  • It is not well documented
  • It requires creating real pipelines
    • It can pollute cluster state with in-process process pipelines
    • Others can execute the pipelines outside the scope of simulate
    • It is too easy to forget to delete the in-process pipelines
    • Any future tooling to help build pipelines would not want to have to create real pipelines just for simulation.

The proposal here is to create a new "pipelines" top level array for the _simulate API which can be used instead of the "pipeline" top level object.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions