Slash could't save in query?

i'm writing a rule to watch the log in watcher,i want query regular expression to match the query body,like:

rq:POST /Web/Public/login HTTP/1.1

part of the rule code is

    "query_string": {
      "fields": [
        "rq.keyword"
      ],
      "query": "/POST \/Web\/Public\/login/"
    }

when is click the save button,the Escape character is missing,then,the rule could not be executed.

    "query_string": {
      "fields": [
        "rq.keyword"
      ],
      "query": "/POST /Web/Public/login/"
    }

have you tried double escaping using two backslashes?

1 Like

thks,this work for me.:grinning:

"query": "/POST \\/Web\\/Public\\/login.*/"

i alse found the slimilar answer there

https://stackoverflow.com/questions/40414944/uri-search-fails-with-parse-exception-when-query-string-contains-slash

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