cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Nested quotation marks

eriknois
Visitor

Hello, I am trying to parse two values from the content field, but ran into a problem with quotation marks.

Here's a shortened version of the record:
content:{"contextMap":{"id:"a1","details":["
description":"amount","grossAmount":20,

My parse without double quotation marks looks like this and only results in a null return value:
| parse content, "LD 'description' WORD:description, LD 'grossAmount' INT:grossAmount"

If I change it to include the double quotes it breaks the query:
| parse content, "LD 'description":"' WORD:description, LD 'grossAmount":' INT:grossAmount"

How can I use double quotes without breaking the parse query?

2 REPLIES 2

sinisa_zubic
Dynatrace Champion
Dynatrace Champion

Hi @eriknois 

 

You can use triple quotes

data record(content="""content:{"contextMap":{"id:"a1","details":["description":"amount","grossAmount":20]""")

| parse content, """LD '"description":' DQS:amount ',"grossAmount":' INT:grossAmount"""

 

Best,
Sini

Great, thank you for the quick reply!

Featured Posts