How to make nested JSON a string with escaped quotes?

I am making a Watch that outputs something like this:

{
"nonIdentifyingInfo": {"loginAttempts": 2},
"identifyingInfo":{"domain": "domain_01", "userName": "john_doe"},
"baseAlertId": 1
}

However, I need the nested JSON to be a string with escaped quotes like this:

{
"nonIdentifyingInfo": "{"loginAttempts": "1"}",
"identifyingInfo": "{"userName": "john_doe", "domain": "domain_01"}",
"baseAlertId": 1
}

My current workaround is a painless script that makes the above output, but I was looking for a more dynamic solution. Any ideas?

I'm not sure if I forgot to escape the inner quotes or they were just automatically removed, but the inner quotes are supposed to be escaped.

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