Home > Enterprise >  elasticsearch pipeline doesn't match paths
elasticsearch pipeline doesn't match paths

Time:08-05

i'm trying to catch the paths that contains a specified path like path/to/my/url/variablePart, in the pipeline condition i put ctx.url.path == 'path/to/my/url/' but unfortunately it takes only the logs that have path/to/my/url/ without considering the other ones with a variable part, there is a wildcard that can help me to catch every path that start with 'path/to/my/url/'?? I have already tried to do ctx.url.path == 'path/to/my/url/*' but without effect. thanks for the help!

CodePudding user response:

You have two options:

A. use a regular expression match:

"if": "ctx.url.path =~ /^path\\\/to\\\/my\\\/url\\\//",

B. use the String.indexOf() function

"if": "ctx.url.path.indexOf('path\/to\/my\/url\/') == 0",

CodePudding user response:

this is a peculiar situation, the path must be something like this, but instead set 'ctx.url.path == 'path/to/my/url/*' i would suggest you to use the percentage % in order to be: 'ctx.url.path == 'path/to/my/url/%' this should select all the sub paths in the directory. If it still gets errors or doesn't respond you correctly, let me know..

  • Related