From the below debug module , I try filter the ouput
name: status of the output
debug:
msg: “status of {{serverName}} is {{ [9] | map(‘extract’, stat_out[0].split(‘,’)) }}”
register: server_status
The output is
TASK [status of the output] *******************************************************************************************
ok: [localhost] =>
msg: ‘status of client11 is [’’ “Status”: “Completed”‘’]’
and when I try to still filter the output , but missing a delimiter (like cut -d: -f1).
Expecting the output as below .
msg: ‘status of the server client11.example.com is [Completed]’
Any String(Word) like Completed or Failed to be captured in
can you provide a bit more context, i.e. where does the variable stat_out comes from.
Or maybe even better prodvide what debugging the entire variable throws at you
name: status of the output
debug:
msg: “status of {{serverName}} is {{ [9] | map(‘extract’, stat_out[0].split(‘,’)) }}”
register: server_status
ignore_errors: yes
The output is
TASK [status of the output] *******************************************************************************************
ok: [localhost] =>
msg: ‘status of client11 is [’’ “Status”: “Completed”‘’]’