I will like to create an alert if an event has “httpStatus” : 400
and “errorCode” : “40000”
.
Can someone help with a regular expression? The log looks something like this:
“UserMessage” : “Bad Request”,
“DeveloperMessage” : xxxxxxxxxxxxxxxxxcxxx
“HttpStatus” : 400,
“ErrorCode” : “40000”,
“GatewayErrors : “xxxx”
Xxxxxx
Xxxxxx
I tried string search /“HtHttpStatus” : 400, “ErrorCode” : “40000” and /[“HttpStatus” : 400], [“ErrorCode” : “40000” ]a
try Regex:
/“HttpStatus” : 400,.*“ErrorCode” : “40000”/s
Demo
As mentioned in this link,
/s
considers the content as being on a single line, ignoring intervening carriage returns and new line characters. With this modifier both the Consider the content as being on a single line, ignoring intervening carriage returns and new line characters. With this modifier both the [\w\W]* character class and the .* pattern will match across new lines and carriage returns. character class and the.*
pattern will match across new lines and carriage returns.