Slash could't save in query?

alerting

(JackJun) #1

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/"
    }

(Alexander Reelsen) #2

have you tried double escaping using two backslashes?


(JackJun) #3

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


(system) #4

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