Hi Sandeep thanks for your feedback, below is the deboug log for this curl
2018-09-18 17:23:23,154 DEBUG hadoop.gateway (UrlRewriteProcessor.java:rewrite(166)) - Rewrote URL: https://<host-knox>:8443/gateway/default/es5/<index_name>/_msearch, direction: IN via explicit rule: ES5/inbound/query to URL: http:// <host-elast>:9200/<index_name>/_msearch 2018-09-18 17:23:23,156 DEBUG hadoop.gateway (ElasticsearchDispatch.java:executeOutboundRequest(79)) - Dispatch request: POST http://<host-elast>:9200/<index_name>/_msearch?doAs=<u_user> 2018-09-18 17:23:23,193 DEBUG hadoop.gateway (ElasticsearchDispatch.java:executeOutboundRequest(95)) - Dispatch response status: 400 2018-09-18 17:23:23,194 DEBUG hadoop.gateway (DefaultDispatch.java:getInboundResponseContentType(202)) - Using explicit character set UTF-8 for entity of type application/json 2018-09-18 17:23:23,195 DEBUG hadoop.gateway (DefaultDispatch.java:getInboundResponseContentType(210)) - Inbound response entity content type: application/json; charset=UTF-8 2018-09-18 17:23:54,519 DEBUG hadoop.gateway (GatewayFilter.java:doFilter(116)) - Received request: POST /es5/<index_name>/_msearch 2018-09-18 17:23:54,521 INFO hadoop.gateway (AclsAuthorizationFilter.java:doFilter(85)) - Access Granted: true Regards Rabii Le ven. 21 sept. 2018 à 17:17, Sandeep Moré <[email protected]> a écrit : > Hello Rab, > > Interesting, do you have the debug logs for this ? they will tell us > exactly what is happening. > > Best, > Sandeep > > On Fri, Sep 21, 2018 at 9:56 AM rabii lamriq <[email protected]> wrote: > >> Hi All, >> >> From Grafana, I Post multisearch query to Elasticsearch using the bulk >> API with the newline delimited JSON (NDJSON) format. >> https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html >> like this: >> >> curl -u myuser -i -H “Content-Type: application/json” -XPOST " >> http://host_ES:900/index/_msearch" --data-binary ’ >> { first json doc} >> {second json doc} >> ’ >> when bypassing Knox, The query work well either we made json or x-ndjson, >> However, through Knox gateway, if the content-type=application/json, the >> query retun this error of 400: >> >> HTTP/1.1 400 Bad Request >> content-type: application/json >> >> But when we replace json by x-ndjson like mentioned in the bulk API, it >> work well. >> >> My problem is that Grafana send their query with the >> content-type=application/json and not x-ndjson, for this, it is possible to >> make any thing on Knox to solve this problem? >> >> Regards >> Rab >> >
