ES Plugin to log rest requests

I have a plugin that logs all rest requests . Currently this is implemented using getRestHandlerWrapper with my plugins RestHandler.

What is other way i can achieve the same without using getRestHandlerWrapper as i understand only one plugin in the cluster can implement this.


Hi @s1monw sorry for tagging you directly here .. but i was hoping if you have a quick note on this.

only one plugin per node can implement this, not per cluster. There is no other way to implement this right now.

Thanks for the response @s1monw , I truly appreciate it. Do you know if this will/might change in future releases?

Also i came across this test Case in elastic codebase -

Where the comment says "Action filter that will reject the request if it isn't authenticated." and when i look at void apply method inside TestFilter , its doing
chain.proceed(task, action, request, listener);

How is this different? Isn't it also pre-processing the rest requests for authentication?

The chain you see there is for transport actions. This is an older way of extending, which rest actions used to also do. However, the chaining was complicated and error prone. Transport actions will eventually be moved to a singular wrapper as well. It is unlikely this will be relaxed in the future, as the complexity of supporting multiple was too cumbersome to maintain.

1 Like

Thanks for the information. It is helpful.

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