25 Nov 2024 02:49 PM
Hi everyone,
I’m working with DQL in Dynatrace notebooks, and I need to format my query into a JSON payload for use in the Dynatrace WebUI. The challenge is that several characters—like double quotes ("), backslashes (\), and newlines (\n)—need to be escaped properly to make it valid JSON.
Is there a converter or tool available to automatically transform the DQL query (as written in a notebook) into the JSON-compatible format needed for WebUI queries?
If not, how do you typically handle this? I’m open to suggestions, such as scripts, tools, or best practices for efficiently managing this process.
Thank you in advance
26 Nov 2024 09:01 AM - edited 26 Nov 2024 09:06 AM
There are two ways you could tackle this issue:
1. When you execute your DQL query, you can set the display options (Options -> Visualization) to "raw response". That will display the whole Grail response in JSON format. Scrolling down to the "metadata" object you will find your DQL query in the JSON payload (see metadata.grail.query)
2. Copy your DQL into any JSON converter (e.g. https://jsontostring.com/) that will translate your payload to JSON-compatible string