Hi,

I suspect your script may show ewverything in 'sh clock' output and not the 
partial output i wanted.  Thanks for the links, will check them.

Regards,
Vikram

On Tuesday, 11 May, 2021 at 7:43:29 am UTC+5:30 [email protected] wrote:

> something like   - "{{ show_clock.stdout[0] | 
> regex_findall('[A-Z][a-z]{2}\s[0-9]{2}\s[0-9]{4}')" should work although I 
> am no expert so there may be a better way to do it.   
> I found  https://regexone.com/  to be helpful to learn the basics  and 
> https://regex101.com/ for testing.
>
> On Monday, May 10, 2021 at 1:55:38 PM UTC-6 Vikram S wrote:
>
>> In below output, i want only the 'May 11 2021' to be displayed on screen.
>> *Switch#sh clock*
>> *02:42:19.622 Sng Tue May 11 2021*
>>
>> Below is a sample script and used 'regex' filter as an example. How do i 
>> modify the script/ incorporate other any other filter such that my above 
>> objective is achieved?
>>
>> - name: GATHER SHOW VERSION
>>   ios_command: 
>>     commands: "show clock"
>>
>>   register: show_clock
>>
>> - debug: 
>>     msg: 
>>     - "{{ show_clock.stdout[0] | regex_findall('.....)"
>>
>> Thanks,
>> Vikram
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7ac8d2e9-9368-4f20-8f05-c190ea2c6014n%40googlegroups.com.

Reply via email to