On 10.04.19 04:38, Saranya N wrote: > Stdout_lines that I get contains strings , json in different lines. > > I want to capture the last line and copy those contents to a a new Json file. > > How do I capture the last line from the registered variable. > > I tried this and it didn't work. > > "{{ Regvar.stdout_lines | last }}"
Try {{ regvar.stdout_lines[-1] }} > -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537 -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1fbac0ec-8f58-28f5-6d6f-27e0ac952a39%40b1-systems.de. For more options, visit https://groups.google.com/d/optout.