Okay, the data is too big to paste in this system but I did store it as a regex101 example:
https://regex101.com/r/No8Xnc/2
The real issue is "property25" which in the real world is an application stack trace formatted as xml. This data has a ton of double quotes and other other escape characters and is really long. If I remove that field the regex works just fine.
If you pull the example into a query you'll have to find/replace single quotes with \" and then replace \" with \\". This sample without property25 works just fine:
| makeresults
| eval quotedJSON = "{
\"InstrumentationLogDateTime\": \"2018-06-28T13:49:33.7895781-04:00\",
\"property1\": \"00000000-1111-2222-3333-444444444444\",
\"property2\": \"00000000-1111-2222-3333-444444444444\",
\"property3\": \"my application\",
\"property4\": \"00000000-1111-2222-3333-444444444444\",
\"property5\": \"V0300\",
\"property6\": \"999918\",
\"property7\": \"system\",
\"property8\": \"Info\",
\"property9\": \"123456\",
\"property10\": \"xx\",
\"property11\": \"xx\",
\"property12\": \"page name\",
\"property13\": \"class name\",
\"property14\": \"method name\",
\"property15\": \"123456\",
\"property16\": \"123456\",
\"property17\": 42,
\"property18\": \"xx\",
\"property19\": \"xx\",
\"property20\": \"123456\",
\"property21\": \"trans name\",
\"property22\": \"42\",
\"property23\": \"2018-06-28T13:49:28\",
\"property24\": \"Object reference not set to an instance of an object.\",
\"CustomFields\": {
\"property26\": \"\",
\"property27\": \"xx\",
\"property28\": \"anotherbiglongvalue\",
\"property29\": \"xx\",
\"property31\": \"\",
\"property32\": \"123456\",
\"property33\": \"anotherbiglongvalue.anotherbiglongvalue.anotherbiglongvalue\",
\"property34\": \"anotherbiglongvalue,anotherbiglongvalue,anotherbiglongvalue\",
\"property35\": \"anotherbiglongvalueanotherbiglongvalueanotherbiglongvalue\",
\"property36\": \"this is a big ol thing\",
\"property37\": \"this is a big ol thing\",
\"property38\": \"this is a big ol thing\",
\"property39\": \"2018-06-28T13:49:33.0000000-04:00\",
\"property40\": \"2018-06-28T13:32:24.0000000-04:00\"
}
}"
| rex field=quotedJSON
"(?x-i)
(?(DEFINE)
(?<ws>[\r\n\t\x20]*)
(?<str>\"(?:\\[rntbf\\\/] | \\\\\" | [[:xdigit:]]{4} | [^\\\"[:cntrl:]])*\")
(?<bool>true|false)
(?<nil>nil)
(?<num>-?\d+(?:\.\d+)?)
(?<elem>(?:(?&str)|(?&bool)|(?&nil)|(?&num))(?&ws))
(?<comma>,(?&ws))
)
(?<extractedJSON>
\[ (?&ws)
(?:
(?:
(?&elem) | (?R)(?&ws)
)
(?(?=(?&comma)(?:(?&elem)|[\[\{]))(?&comma))
)*
\]
|
\{ (?&ws)
(?:
(?&str) (?&ws)
: (?&ws)
(?:
(?&elem) | (?R)(?&ws)
)
(?(?=(?&comma)[\"\[\{])(?&comma))
)*
\}
)"
| eval rawSameAsExtracted = if(_raw=extractedJSON, "true", "false")
| table quotedJSON, extractedJSON, rawSameAsExtracted
... View more