Question

I'm trying to "Include Only" about 40 URLs for a specific profile view. I set up three Request URI filters that use "Include Only" and the following regex:

FIRST:

/(subdirectory1|subdirectory2|subdirectory3|subdirectory4)/
(That goes on and on for about 15 subdirectories)

SECOND:

/(subdirectory16|subdirectory17|subdirectory18|subdirectory19)/
(That goes on and on for another 15 subdirectories).

THIRD:

Same thing for whatever remains.

If I only have ONE "Include Only" Request URI filter set up this way, it works. As soon as I add a second filter, it stops tracking everything. Unfortunately, I can't fit all URLs in the one filter.

How can I accomplish this?

Thanks.

No correct solution

OTHER TIPS

The first filter includes the subdirectories 1-15 (if numbered sequentially). Everything else is thrown away. The second filter works on what is left, so from the sequence subdirectory1 to subdirectory15 it only includes those that match the pattern subdirectory16-subdirectory25. Which is none of them.

Filters are applied in the order that they are defined and they are destructive, data that has been deleted in a previous filter is not evaluated in a subsequent filter, hence you see nothing.

An standard include filter does not accept regular expressions (whith the exception of the "|" character). However as far as I know (and according to the documentation) the advanced include filter does.

I'm not great with regular expression, but the following pattern should work or at least be good enough to get you going:

\/subdirectory([1-2][1-9]|[1-9])

The first bit is your directory name. The bit in parenthesis should match the numbers. Specifically:

[1-2][1-9]

should match numbers from 11 to 29 (these are character classes, regex treats numbers as characters not as numbers. So this bit looks for something that starts with 1 or two and is followed by one of the numbers 1,2,3,4,5,6,7,8,9).

Then there is your "or"-sign and a second expression to match numbers that have only one digit.

Change the character classes according to your needs.

You'd have to go from predefined to advanced filter, set "include", use "RequestURI" as filter field and enter the expression. That should work (I admit I haven't tested it).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top