# How to make Dev tools request automatic using the Pipeline?

**URL:** <https://discuss.elastic.co/t/how-to-make-dev-tools-request-automatic-using-the-pipeline/292377>\
**Category:** Kibana\
**Created:** [December 18, 2021, 9:58am UTC](https://discuss.elastic.co/t/how-to-make-dev-tools-request-automatic-using-the-pipeline/292377 "2021-12-18T09:58:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Angad\_Panesar1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/angad_panesar1/32/79499_2.png) [@Angad\_Panesar1](https://discuss.elastic.co/u/Angad_Panesar1)\
**Post date:** [December 18, 2021, 9:58am UTC](https://discuss.elastic.co/t/how-to-make-dev-tools-request-automatic-using-the-pipeline/292377/1 "2021-12-18T09:58:48Z")

</div>

Hi, I tried to create an ingest pipeline to run every time new data is ingested but unfortunately it still does not work. Here is what I have done:

The create pipeline method:

```auto
PUT _ingest/pipeline/set_place
{
  "description": "create a field called place and sets garage to it.",
  "processors": [
    {
      "set": {
        "field": "place",
        "value": "garage",
        "if": "ctx?.ID == '3c71bf6eb508'"
      }
    }
  ]
}

```

The simulate pipeline method:

```auto
POST _ingest/pipeline/set_place/_simulate
{
  "docs": [
    {
      "_source": {
        "ID": "3c71bf6eb508"
      }
    }
  ]
}

```

The simulate pipeline method does not work even when new data is added. Is there any way that you can help me with this please?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 18, 2021, 6:14pm UTC](https://discuss.elastic.co/t/how-to-make-dev-tools-request-automatic-using-the-pipeline/292377/2 "2021-12-18T18:14:39Z")

</div>

I think there's a little confusion.

The simulate only simulates with that doc you provide.

You have to configure the pipeline to be executed when the document is ingested, this is what they are made for.

Depending on tool / method (Filebeat, Logstash, Client, POST) method are you using to ingest the data, will define how to call the pipeline on document ingest.

Tell us that, how you are ingesting your data, and we can show you how to set the pipeline to be used?

You can also just set your pipeline as the `default_pipeline` using this setting in your index or template See [Here](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#dynamic-index-settings) a bit down the page

```auto
PUT _ingest/pipeline/set_place
{
  "description": "create a field called place and sets garage to it.",
  "processors": [
    {
      "set": {
        "field": "place",
        "value": "garage",
        "if": "ctx?.ID == '3c71bf6eb508'"
      }
    }
  ]
}

# Setting the default pipeline, you could set this in your template 

PUT my-place-index/
{
  "settings": {
    "index.default_pipeline" : "set_place"
    
  }
}

```

```auto
# Index / ingest a document 
POST my-place-index/_doc
{
  "myfield" : "myvalue",
  "ID": "3c71bf6eb508"
}

```

results, the pipeline is executed when the document is ingested.

```auto
{
  "took" : 835,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 1,
      "relation" : "eq"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "my-place-index",
        "_type" : "_doc",
        "_id" : "VqC_zn0BEq8CUkeUD7Wg",
        "_score" : 1.0,
        "_source" : {
          "ID" : "3c71bf6eb508",
          "place" : "garage",
          "myfield" : "myvalue"
        }
      }
    ]
  }
}

```

OR if you don't set it as a default pipeline you can just do this and call the pipeline explicitly

```auto
POST my-place-other-index/_doc?pipeline=set_place
{
  "myfield" : "myvalue",
  "ID": "3c71bf6eb508"
}

```

And the pipeline will be executed...

```auto
GET my-place-other-index/_search

{
  "took" : 0,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 1,
      "relation" : "eq"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "my-place-other-index",
        "_type" : "_doc",
        "_id" : "WaDmzn0BEq8CUkeUoLXM",
        "_score" : 1.0,
        "_source" : {
          "ID" : "3c71bf6eb508",
          "place" : "garage",
          "myfield" : "myvalue"
        }
      }
    ]
  }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 15, 2022, 6:15pm UTC](https://discuss.elastic.co/t/how-to-make-dev-tools-request-automatic-using-the-pipeline/292377/3 "2022-01-15T18:15:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
