How to make Dev tools request automatic?

How would I make a request automatically update the data over time instead of just manually going into dev tools and running the request every time. e.g. after 1 hour. See the request below.

POST compair_*/_update_by_query?refresh=true
{"script":{"inline":"ctx._source.place = \"no room\"","lang":"painless"},"query":{"match":{"ID":"4c11aeade47c"}}}

I tried adding ?refresh=true at the end and it still would not automatically update the data. Please can you help me.

I don't believe that is possible.

Seems like what you are looking to do is create an ingest pipeline that could run this every time new data is ingested. Therefor it's always correct before it even gets indexed.

Here is a simulation on how it would work.

POST _ingest/pipeline/_simulate
{
  "pipeline": {
    "processors": [
      {
        "set": {
          "field": "place",
          "value": "no room",
          "if": "ctx?.ID == '4c11aeade47c'"
        }
      }
    ]
  },
  "docs": [
    {
      "_source": {
        "ID": "not 4c11aeade47"
      }
    },
    {
      "_source": {
        "ID": "4c11aeade47c"
      }
    }
  ]
}

I tried the pipeline method but it still did not work. What I wanted to say was on Dev Tools can the attribute "place" be automatically added with that value when the new data with that ID comes in?

Is there any other way that you can help me please?

Not in Dev Tools. The only way I can think of is using an Ingest Pipeline. What I posted above was just a simulation. You would need build out the pipeline and attach it to your index.

If you run into issues doing that then I would create a new post in the Elasticsearch category and someone might be able to help walk you through it.

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