


We want a logging filter to support multiple different groups of endpoints, e.g. /bin/proxy/.*, /bin/someApi/v2.* etc. We could try to create a regexp that matches each pattern we want to add, or is there a way to add multiple patterns? Or we could create a filter for each pattern, and point to some common code.
@SlingServletFilter(scope = { SlingServletFilterScope.REQUEST }, pattern = "/bin/someApi/v2/.*", methods = { "GET",
"POST" })
Views
Replies
Sign in to like this content
Total Likes
Hi @TB3dock,
Base on documentation:
Pattern attribute accepts single String value.
Answering your question multiple patters are not supported, to achieve your goal you should follow one of the option you already mentioned:
please check https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple... and see if that helps.
It can be done by using attribute 'sling.filter.pattern'. Please have a look at the below URL for more details.
https://sling.apache.org/documentation/the-sling-engine/filters.html
Hi @TB3dock,
Base on documentation:
Pattern attribute accepts single String value.
Answering your question multiple patters are not supported, to achieve your goal you should follow one of the option you already mentioned: