# How to parse the following nested json

**URL:** https://discuss.elastic.co/t/how-to-parse-the-following-nested-json/285959
**Category:** Logstash
**Created:** [October 5, 2021, 6:28pm UTC](https://discuss.elastic.co/t/how-to-parse-the-following-nested-json/285959 "2021-10-05T18:28:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bvoros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bvoros/32/5246_2.png) [@bvoros](https://discuss.elastic.co/u/bvoros)
#### Post date: [October 5, 2021, 6:28pm UTC](https://discuss.elastic.co/t/how-to-parse-the-following-nested-json/285959/1 "2021-10-05T18:28:33Z")

</div>

Hello,

I would like to know how to parse the list of nested json "documents" inside a json list field.

Thank you in advance,

There is that list of name and value pairs in the following format:

```auto
{
  "list": [
    {
      "name": "colour",
      "value": "blue"
    },
    {
      "name": "size",
      "value": "big"
    }
  ]
}

```

Example data:

```auto
  "httpRequest": {
    "clientIp": "10.223.156.225",
    "country": "IE",
    "headers": [
      {
        "name": "host",
        "value": "host.uat..com"
      },
      {
        "name": "pragma",
        "value": "no-cache"
      },
      {
        "name": "cache-control",
        "value": "no-cache"
      },
      {
        "name": "sec-ch-ua",
        "value": "\"Chromium\";v=\"94\", \"Google Chrome\";v=\"94\", \";Not A Brand\";v=\"99\""
      },
      {
        "name": "sec-ch-ua-mobile",
        "value": "?0"
      },
      {
        "name": "user-agent",
        "value": "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36"
      },
      {
        "name": "sec-ch-ua-platform",
        "value": "\"Windows\""
      },
      {
        "name": "accept",
        "value": "image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"
      },
      {
        "name": "sec-fetch-site",
        "value": "same-origin"
      },
      {
        "name": "sec-fetch-mode",
        "value": "no-cors"
      },
      {
        "name": "sec-fetch-dest",
        "value": "image"
      },
      {
        "name": "referer",
        "value": "https://host.uat.com/"
      },
      {
        "name": "accept-encoding",
        "value": "gzip, deflate, br"
      },
      {
        "name": "accept-language",
        "value": "en-US,en;q=0.9"
      },
      {
        "name": "cookie",
        "value": "SERVERID=srv2; session=1ad9aa7763623b39-00000001000030e8"
      }
    ],
    "uri": "/favicon.ico",
    "args": "",
    "httpVersion": "HTTP/2.0",
    "httpMethod": "GET",
    "requestId": "1-615b7307-0bd4eea337c65bbf4271d2fa"
  }

```

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [October 5, 2021, 6:53pm UTC](https://discuss.elastic.co/t/how-to-parse-the-following-nested-json/285959/2 "2021-10-05T18:53:35Z")

</div>

If you want to flatten those headers there is an example [here](https://discuss.elastic.co/t/solved-split-filter-question-a-k-a-flatten-json-sub-array/130481/12).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [November 2, 2021, 6:54pm UTC](https://discuss.elastic.co/t/how-to-parse-the-following-nested-json/285959/3 "2021-11-02T18:54:29Z")

</div>

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