# Parsing a JSON with special characters.

**URL:** <https://community.dynatrace.com/t/parsing-a-json-with-special-characters/44867>\
**Category:** DQL\
**Tags:** dql\
**Created:** [March 26, 2024, 2:04pm UTC](https://community.dynatrace.com/t/parsing-a-json-with-special-characters/44867 "2024-03-26T14:04:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ellery](https://avatars.discourse-cdn.com/v4/letter/e/5e9695/32.png) [@Ellery](https://community.dynatrace.com/u/Ellery)\
**Post date:** [March 26, 2024, 2:04pm UTC](https://community.dynatrace.com/t/parsing-a-json-with-special-characters/44867/1 "2024-03-26T14:04:42Z")

</div>

Hello, I have the following response that I need to parse, it’s basically a JSON object where I need to retrieve the field ‘x-real-ip,’ but Dynatrace marks the character ‘-’ as invalid.

```markup
"headers": {
          "accept": "application/json, text/plain, */*",
          "accept-encoding": "gzip, deflate, br, zstd",
          "accept-language": "es-CL,es;q=0.9,en;q=0.8,en-US;q=0.7",
          "content-length": "3840",
          "content-type": "application/json",
          "cookie": "_ga=GA1.1.807424739.1711029955; dtCookie=v_4_srv_3_sn_AD0CB92A9B023486D52C166472FF433A_perc_100000_ol_0_mul_1_app-xxxxxxxxxx; rxVisitor=xxxxxxxxxx; dtSa=-; rxvt=1711457578849|1711454729279; dtPC=3$255775100_625h1vRHSFFAMLCWIPMNKLPUMKNBDGTBACILCR-0e0; _ga_VRHGLJ0CC3=GS1.1.1711455778.7.1.1711455787.51.0.0",
          "host": "prod.salud.achs.cl",
          "origin": "xxxxxxxxxx",
          "referer": "xxxxxxxxxx",
          "sec-ch-ua": "\"Google Chrome\";v=\"123\", \"Not:A-Brand\";v=\"8\", \"Chromium\";v=\"123\"",
          "sec-ch-ua-mobile": "?0",
          "sec-ch-ua-platform": "\"xxxxxxxxxx\"",
          "sec-fetch-dest": "empty",
          "sec-fetch-mode": "cors",
          "sec-fetch-site": "same-origin",
          "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
          "x-access-token": "xxxxxxxxxx",
          "x-dynatrace-application": "v=2;appId=c70633ee2206b4f0;injectionRule=auto;cookieDomain=achs.cl;rid=-xxxxxxxxxx;rpid=xxxxxxxxxx;en=e27ehw6g",
          "x-forwarded-for": "10.246.36.39",
          "x-forwarded-host": "xxxxxxxxxx",
          "x-forwarded-port": "443",
          "x-forwarded-proto": "https",
          "x-forwarded-scheme": "https",
          "x-real-ip": "10.12.36.121",
          "x-request-id": "373e44e474c844e6df809215447ffb12",
          "x-scheme": "https"
        },

```

my dql Code its:

```markup
| PARSE content, "JSON{JSON:message}:parsejson"
| fields timestamp, alias:fecha,
	parsejson[message][properties][data][body][xxxxxxx], alias:xxxxxxx,
	parsejson[message][properties][data][body][xxxxxxx], alias:xxxxxxx,
	parsejson[message][properties][data][body][servicioIdentificacion][xxxxxxx], alias:xxxxxxx, 
	parsejson[message][properties][data][body][documentosMatriz][0][xxxxxxx], alias:xxxxxxx,
	parsejson[message][properties][data][body][documentosMatriz][0][xxxxxxx], alias:xxxxxxx,
	parsejson[message][properties][data][body][documentosMatriz][0][xxxxxxx], alias:xxxxxxx,
	parsejson[message][properties][data][headers][x-real-ip], alias:ip

```

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [March 27, 2024, 10:40am UTC](https://community.dynatrace.com/t/parsing-a-json-with-special-characters/44867/2 "2024-03-27T10:40:08Z")

</div>

Please use backticks: `x-real-ip`

Kris

---

<div class="post-metadata">

**Author:** ![Ellery](https://avatars.discourse-cdn.com/v4/letter/e/5e9695/32.png) [@Ellery](https://community.dynatrace.com/u/Ellery)\
**Post date:** [March 27, 2024, 7:27pm UTC](https://community.dynatrace.com/t/parsing-a-json-with-special-characters/44867/3 "2024-03-27T19:27:40Z")

</div>

thanks, works perfects !!
