On Friday, 30 November 2018 22:39:46 CET Saravanan wrote:
> Hi Ansible Experts,
> Need help to capture the JBOSS EAP JVM uptime value through Ansible
> playbook. From the below task stdout need to parse the uptime value which
> is in numeric field to a variable.
>
> {
> "outcome" => "success",
> "result" => 3613082543L
> }
>
> Can you please suggest the right string parsing method to achieve this? I
> was unable to use Unix commands like grep/ awk/ sed to filter this numeric
> value.
You have not provided the task, but if you are using the shell module just add
| awk '/result/ { print $3 }'
and you stdout will only contain that value.
--
Kai Stian Olstad
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/1931599.Qgvfs2HpBR%40x1.
For more options, visit https://groups.google.com/d/optout.