We are a little confused here, playing with ES|QL and RLIKE in Discover:.
This one works and returns paths like \\?\C:\Windows\CSC\v2.0.6\namespace\example.com\DFS\Homes\User\Downloads\evil.exe
| WHERE file.path RLIKE ".*\\DFS.Homes.*"
Moving the backslashes to the back suddenly returns no results anymore?
| WHERE file.path RLIKE ".*DFS.Homes\\.*"
Even worse, adding more than one “double backslash” returns an error?
| WHERE file.path RLIKE ".*\\DFS\\Homes.*"
[esql] > Couldn't parse Elasticsearch ES|QL query. Check your query and try again. Error: line 2:9: Invalid regex pattern for RLIKE [.*\DFS\Homes.*]: [invalid character class \72]
Doing something like this still returns the same results as the first one even though there's too many slashes:
| WHERE file.path RLIKE ".*\\\\\\DFS.Homes.*"
Yet, adding more then returns no results again.
| WHERE file.path RLIKE ".*\\\\\\\\DFS.Homes.*"
Maybe we are just tired, but this doesn’t make sense to us?