Windows path (backslash-rich) regexp not working

I'm using elastic v5.5.1. I have data that basically looks like windows network path globs that I would like to search for using a regexp. I have simplified the problem down to the following example:

PUT regexp-test
{ 
  "settings" : { 
    "index" : {
      "number_of_shards" : 1, 
      "number_of_replicas" : 0
    }
  },
  "mappings": {
    "doc": {
      "properties": {
        "path": { 
          "type": "keyword"
        }
      }
    }
  }
}

PUT regexp-test/doc/1/_create
{
    "path" : "\\\\*\\c$",
    "post_date" : "2017-10-23T09:00:00"
}
PUT regexp-test/doc/2/_create
{
    "path" : "\\\\*\\d$",
    "post_date" : "2017-10-23T09:05:00"
}

# this does not match anything, although I expect it to since it should match both
# of the above logs
GET regexp-test/_search
{ 
  "query": { "regexp": { "path": "\\\\\\\\.*\\\\" } } 
}

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