# ES msearch responses 404 when using GET while it reponses 200 when using POST

**URL:** <https://discuss.elastic.co/t/es-msearch-responses-404-when-using-get-while-it-reponses-200-when-using-post/213902>\
**Category:** Elasticsearch\
**Created:** [January 6, 2020, 2:40pm UTC](https://discuss.elastic.co/t/es-msearch-responses-404-when-using-get-while-it-reponses-200-when-using-post/213902 "2020-01-06T14:40:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zeng\_Sharp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zeng_sharp/32/60330_2.png) [@Zeng\_Sharp](https://discuss.elastic.co/u/Zeng_Sharp)\
**Post date:** [January 6, 2020, 2:40pm UTC](https://discuss.elastic.co/t/es-msearch-responses-404-when-using-get-while-it-reponses-200-when-using-post/213902/1 "2020-01-06T14:40:16Z")

</div>

Could you help explain why the behavior is different between GET and POST? And advise how to make it work when using GET? Thanks in advance.

curl --location --request GET '[http://kibana.xxx.xxx.xx:5601/elasticsearch/\_msearch](http://kibana.xxx.xxx.xx:5601/elasticsearch/_msearch)'   
--header 'Content-Type: application/x-ndjson'   
--header 'kbn-version: 6.8.3'   
--data-raw '{"index": "_-xxx-_"}  
{"aggs":{"2":{"terms":{"field":"env\_name","size":50,"order":{"\_key":"asc"}}}},"size":0,"\_source":{"excludes":},"stored\_fields":["\*"],"script\_fields":{},"docvalue\_fields":[{"field":"@timestamp","format":"date\_time"},{"field":"timestamp","format":"date\_time"}],"query":{"bool":{"must":[{"range":{"@timestamp":{"gte":1577669673076,"lte":1578274473076,"format":"epoch\_millis"}}}],"filter":[{"match\_all":{}},{"bool":{"filter":[{"bool":{"should":[{"bool":{"should":[{"match":{"env\_name":"xxx"}}],"minimum\_should\_match":1}},{"bool":{"should":[{"match":{"location":"xxx"}}],"minimum\_should\_match":1}}],"minimum\_should\_match":1}},{"bool":{"should":[{"match\_phrase":{"uri":"/xxx/xxx/xxx"}}],"minimum\_should\_match":1}}]}}],"should":,"must\_not":}},"timeout":"30000ms"}

> {  
> "statusCode": 404,  
> "error": "Not Found",  
> "message": "Not Found"  
> }

curl --location --request POST '[http://kibana.xxx.xxx.xx:5601/elasticsearch/\_msearch](http://kibana.xxx.xxx.xx:5601/elasticsearch/_msearch)'   
--header 'Content-Type: application/x-ndjson'   
--header 'kbn-version: 6.8.3'   
--data-raw '{"index": "_-xxx-_"}  
{"aggs":{"2":{"terms":{"field":"env\_name","size":50,"order":{"\_key":"asc"}}}},"size":0,"\_source":{"excludes":},"stored\_fields":["\*"],"script\_fields":{},"docvalue\_fields":[{"field":"@timestamp","format":"date\_time"},{"field":"timestamp","format":"date\_time"}],"query":{"bool":{"must":[{"range":{"@timestamp":{"gte":1577669673076,"lte":1578274473076,"format":"epoch\_millis"}}}],"filter":[{"match\_all":{}},{"bool":{"filter":[{"bool":{"should":[{"bool":{"should":[{"match":{"env\_name":"xxx"}}],"minimum\_should\_match":1}},{"bool":{"should":[{"match":{"location":"xxx"}}],"minimum\_should\_match":1}}],"minimum\_should\_match":1}},{"bool":{"should":[{"match\_phrase":{"uri":"/xxx/xxx/xxx"}}],"minimum\_should\_match":1}}]}}],"should":,"must\_not":}},"timeout":"30000ms"}

> {  
> "responses": [  
> {  
> "took": 14,  
> "timed\_out": false,  
> "\_shards": {  
> "total": 7,  
> "successful": 7,  
> "skipped": 0,  
> "failed": 0  
> },  
> "hits": {  
> "total": 525111,  
> "max\_score": 0,  
> "hits":   
> },  
> "aggregations": {  
> "2": {  
> "doc\_count\_error\_upper\_bound": 0,  
> "sum\_other\_doc\_count": 0,  
> "buckets": [  
> {  
> "key": "xxx",  
> "doc\_count": 682  
> },  
> ...  
> ]  
> }  
> },  
> "status": 200  
> }  
> ]  
> }

---

<div class="post-metadata">

**Author:** ![Zeng\_Sharp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zeng_sharp/32/60330_2.png) [@Zeng\_Sharp](https://discuss.elastic.co/u/Zeng_Sharp)\
**Post date:** [January 8, 2020, 8:25am UTC](https://discuss.elastic.co/t/es-msearch-responses-404-when-using-get-while-it-reponses-200-when-using-post/213902/2 "2020-01-08T08:25:55Z")

</div>

The request should request to ES rather than Kibana, it works after changing to request [http://kibana.xxx.xxx.xx:9200/\_msearch](http://kibana.xxx.xxx.xx:9200/_msearch).

---

<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:** [February 5, 2020, 8:27am UTC](https://discuss.elastic.co/t/es-msearch-responses-404-when-using-get-while-it-reponses-200-when-using-post/213902/3 "2020-02-05T08:27:11Z")

</div>

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