# Extracting list of values from a list of list of dictionaries

**URL:** <https://forum.ansible.com/t/extracting-list-of-values-from-a-list-of-list-of-dictionaries/24031>\
**Category:** Ansible Project\
**Created:** [March 22, 2017, 10:04am UTC](https://forum.ansible.com/t/extracting-list-of-values-from-a-list-of-list-of-dictionaries/24031 "2017-03-22T10:04:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_Kamel](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@Ahmed\_Kamel](https://forum.ansible.com/u/Ahmed_Kamel)\
**Post date:** [March 22, 2017, 10:04am UTC](https://forum.ansible.com/t/extracting-list-of-values-from-a-list-of-list-of-dictionaries/24031/1 "2017-03-22T10:04:17Z")

</div>

Hello,

I have a command running a loop through with items and I get a registered result like the following structure:

```auto
{
    "changed": false,
    "msg": "All items completed",
    "results": [
        {
            "machines": [
                {
                    "ip": "127.0.0.1",
                    "name": "machine1"
                },
                {
                    "ip": "127.0.0.1",
                    "name": "machine2"
                }
            ]
        },
        {
            "machines": [
                {
                    "ip": "127.0.0.1",
                    "name": "machine3"
                },
                {
                    "ip": "127.0.0.1",
                    "name": "machine4"
                }
            ]
        }
    ]
}

```

```auto

```

I wanted to extract a list of machines.name out of it so I used the following filter:

`map(attribute="machines.name")`

And I got a list of Undefined as an output:  
[![](https://lh3.googleusercontent.com/-5BrIwPLx8lc/WNJL1XEU-nI/AAAAAAAAJQA/4MPcLLSvzywvqPlQtZqORgq84rYX_uqrQCLcB/s1600/Selection_133.jpg)](https://lh3.googleusercontent.com/-5BrIwPLx8lc/WNJL1XEU-nI/AAAAAAAAJQA/4MPcLLSvzywvqPlQtZqORgq84rYX_uqrQCLcB/s1600/Selection_133.jpg)

`  
“[Undefined, Undefined]”: “[Undefined, Undefined]”

`

How can I correctly extract a list of machine names out of that data structure?
