Need to parse stdout_lines output

I have a stdout_lines output that I need to grab 2 lines and put into a variable.

Here is the stdout_lines output:

`

“stdout_lines”: [
“WARNING THIS IS A PRIVATE AND PROPRIETARY SYSTEM.”,
"Password: ",
“Last login: Mon Jul 2 23:12:56 2018 from 192.168.1.222”,
“”,
"[root@localhost:Active:Standalone] config # ls /shared/images/*.iso |grep -v "12 ",
“.1.0"|grep -v "13.1.0.7"”,
“/shared/images/BIGIP-11.1.0.-0.0.1.iso”,
“/shared/images/Hotfix-BIGIP-11.1.0.0.45.1-ENG.iso”,
“[root@localhost:Active:Standalone] config # exit”,
“logout”,
“Connection to 192.168.1.225 closed.”
]

`

The debug output that I can get so far with this line:

`

  • debug: msg=“{{file_list.stdout_lines | map(‘regex_findall’,‘/shared/images/.*iso$’) | map(‘join’) | list}}”
    “msg”: [
    “”,
    “”,
    “”,
    “”,
    “”,
    “”,
    “/shared/images/BIGIP-11.1.0.-0.0.1.iso”,
    “/shared/images/Hotfix-BIGIP-11.1.0.0.45.1-ENG.iso”,
    “”,
    “”,
    “”
    ]

`

Anyone know how I can put these 2 lines into their own variable? I know to use set_fact but I don’t know how to extract these lines separately.

You could try:

- set_fact:
     myvar: '{{ file_list.stdout_lines | map("regex_search", "/shared/images/.*iso$") | select("string") | list }}'