Modify the uri of the incoming request - Rest Filter

(SK) #1

Hi All,

I have a custom plugin which implements RestHandler and intercepts the incoming request via the handleRequest method.

I have a requirement that if the incoming query uri is like /*/_search then i need to replace the uri with certain index names defined in elasticsearch.yml file as white list indexes

for ex: if the incoming uri is /*/_search then convert the uri to /index1,index2/_search

i tried creating new custom RestRequest object by extending RestRequest class and setting the path with the modified uri and then chaining the new RestRequest object

this.restHandler.handleRequest(newrequest, channel, client);

However still the query that executed by ES would be /*/_search. How can i achieve the above requirement

(SK) #2

@experts. Any help you can shed on this

(David Pilato) #3

Read this and specifically the "Also be patient" part.

(SK) #4

Sure.. will keep this in my mind for future posts... It would be really helpful if u can help on this.. it's a request

(system) closed #5

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