# Update\_by\_query 404 Not Found

**URL:** <https://discuss.elastic.co/t/update-by-query-404-not-found/90190>\
**Category:** Kibana\
**Created:** [June 21, 2017, 2:57am UTC](https://discuss.elastic.co/t/update-by-query-404-not-found/90190 "2017-06-21T02:57:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![whoami](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@whoami](https://discuss.elastic.co/u/whoami)\
**Post date:** [June 21, 2017, 2:57am UTC](https://discuss.elastic.co/t/update-by-query-404-not-found/90190/1 "2017-06-21T02:57:18Z")

</div>

I use updateByQuery in kibana plugin, but get 404 not found Error, my code as below:

```auto
esAdmin.updateByQuery({
    index: 'logstash-0',
    conflicts: 'proceed',
    body: {
       query: {...},
       doc: {extension: 'png'}
    }
})
.then(resp => {
    console.log(resp);
})

```

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [June 21, 2017, 5:54pm UTC](https://discuss.elastic.co/t/update-by-query-404-not-found/90190/2 "2017-06-21T17:54:00Z")

</div>

Take a look at the Elasticsearch-js documentation on Update By Query: [https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-updatebyquery](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-updatebyquery)

It tells you that what you can enter for the `body` parameter can be found in the Elasticsearch documentation for Update By Query: [https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-update-by-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-update-by-query.html)

It doesn't look like your `doc` field is valid, according to the Elasticsearch documentation.

I would first try querying directly to ES, make sure it works, and then try to port the body of the query into JS code from there.

---

<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:** [July 19, 2017, 5:54pm UTC](https://discuss.elastic.co/t/update-by-query-404-not-found/90190/3 "2017-07-19T17:54:08Z")

</div>

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