Re: [ansible-project] Regular Expression in ANSIBLE

2020-07-02 Thread Stefan Schmid
What may work is using Ansible Modul script.
It returns e.g. as stdout only the requested string.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a016b71f-31f7-46b2-9264-f1b67451e362o%40googlegroups.com.


Re: [ansible-project] Regular Expression in ANSIBLE

2020-07-02 Thread T. JENISHA
It's solved. I was asking about regex.  But I couldn't see your solution.


Thankyou!

Best Regards
Jenisha T
Whatsapp: +91 07598087866





On Thu, 2 Jul 2020 at 15:10, Srinivas Naram 
wrote:

> Not sure how you are initiating your playbooks. Here is what I did.
>
> I initiated my playbooks from a shell script and parsed the output in the
> script.
>
> On Thu, Jul 2, 2020 at 2:03 PM Jenisha T  wrote:
>
>>
>> It's present in a remote server where the playbook is executed. I m
>> facing the problem with extraction. Text present in register.
>>
>> On Thursday, 2 July 2020 at 12:41:37 UTC+5:30 sriniva...@gmail.com wrote:
>>
>>> Hello - is this log file located in the server where Ansible is
>>> installed or remote server ?
>>>
>>> On Thu, Jul 2, 2020 at 5:25 AM Jenisha T  wrote:
>>>
 Hi
 I have output from log file as below. I need to extract the string
 shown in bold.

  Communication Diagnostic Report

 ---


 User Name : username

 Directory : /path/to/dir

 Platform Architecture : Linux

 Version : x.0.00.x

 Host Name : abcdef1234

 Logical Name : *abcdef1234*

 Listen to Network Interface : *ANY


 processes status

 ==

 Listener : *Running as root *


 How to extract the value of Logical Name : *abcdef1234 *

 from the multiline string.


 --
 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-proje...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/cbdb83e6-d7b4-42ec-8d23-408736d0aeb2n%40googlegroups.com
 
 .

>>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/59adf33c-d9c4-4d74-83fc-2e07d2d8e5adn%40googlegroups.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAG-N3P4Khqov%2B3OvwLLig6-s8sEiiGsS23KuhKMS%2BoHB7668hw%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAAGhZYgboeMGTtqwvPYqrWXT_RDXvsePLUXOWDB5MQxuwxeOrw%40mail.gmail.com.


Re: [ansible-project] Regular Expression in ANSIBLE

2020-07-02 Thread Srinivas Naram
Not sure how you are initiating your playbooks. Here is what I did.

I initiated my playbooks from a shell script and parsed the output in the
script.

On Thu, Jul 2, 2020 at 2:03 PM Jenisha T  wrote:

>
> It's present in a remote server where the playbook is executed. I m facing
> the problem with extraction. Text present in register.
>
> On Thursday, 2 July 2020 at 12:41:37 UTC+5:30 sriniva...@gmail.com wrote:
>
>> Hello - is this log file located in the server where Ansible is installed
>> or remote server ?
>>
>> On Thu, Jul 2, 2020 at 5:25 AM Jenisha T  wrote:
>>
>>> Hi
>>> I have output from log file as below. I need to extract the string shown
>>> in bold.
>>>
>>>  Communication Diagnostic Report
>>>
>>> ---
>>>
>>>
>>> User Name : username
>>>
>>> Directory : /path/to/dir
>>>
>>> Platform Architecture : Linux
>>>
>>> Version : x.0.00.x
>>>
>>> Host Name : abcdef1234
>>>
>>> Logical Name : *abcdef1234*
>>>
>>> Listen to Network Interface : *ANY
>>>
>>>
>>> processes status
>>>
>>> ==
>>>
>>> Listener : *Running as root *
>>>
>>>
>>> How to extract the value of Logical Name : *abcdef1234 *
>>>
>>> from the multiline string.
>>>
>>>
>>> --
>>> 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-proje...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/cbdb83e6-d7b4-42ec-8d23-408736d0aeb2n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/59adf33c-d9c4-4d74-83fc-2e07d2d8e5adn%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAG-N3P4Khqov%2B3OvwLLig6-s8sEiiGsS23KuhKMS%2BoHB7668hw%40mail.gmail.com.


Re: [ansible-project] Regular Expression in ANSIBLE

2020-07-02 Thread Jenisha T

It's present in a remote server where the playbook is executed. I m facing 
the problem with extraction. Text present in register.

On Thursday, 2 July 2020 at 12:41:37 UTC+5:30 sriniva...@gmail.com wrote:

> Hello - is this log file located in the server where Ansible is installed 
> or remote server ?
>
> On Thu, Jul 2, 2020 at 5:25 AM Jenisha T  wrote:
>
>> Hi
>> I have output from log file as below. I need to extract the string shown 
>> in bold. 
>>
>>  Communication Diagnostic Report
>>
>> ---
>>
>>
>> User Name : username
>>
>> Directory : /path/to/dir
>>
>> Platform Architecture : Linux
>>
>> Version : x.0.00.x
>>
>> Host Name : abcdef1234
>>
>> Logical Name : *abcdef1234*
>>
>> Listen to Network Interface : *ANY
>>
>>
>> processes status
>>
>> ==
>>
>> Listener : *Running as root * 
>>
>>
>> How to extract the value of Logical Name : *abcdef1234 *
>>
>> from the multiline string. 
>>
>>
>> -- 
>> 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-proje...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/cbdb83e6-d7b4-42ec-8d23-408736d0aeb2n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/59adf33c-d9c4-4d74-83fc-2e07d2d8e5adn%40googlegroups.com.


Re: [ansible-project] Regular Expression in ANSIBLE

2020-07-02 Thread Srinivas Naram
Hello - is this log file located in the server where Ansible is installed
or remote server ?

On Thu, Jul 2, 2020 at 5:25 AM Jenisha T  wrote:

> Hi
> I have output from log file as below. I need to extract the string shown
> in bold.
>
>  Communication Diagnostic Report
>
> ---
>
>
> User Name : username
>
> Directory : /path/to/dir
>
> Platform Architecture : Linux
>
> Version : x.0.00.x
>
> Host Name : abcdef1234
>
> Logical Name : *abcdef1234*
>
> Listen to Network Interface : *ANY
>
>
> processes status
>
> ==
>
> Listener : *Running as root *
>
>
> How to extract the value of Logical Name : *abcdef1234 *
>
> from the multiline string.
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/cbdb83e6-d7b4-42ec-8d23-408736d0aeb2n%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAG-N3P4X4NPOv%2B_QxQLtvELH%3DDomxCWr0weNY%2Bh1vLZnE7Pi3Q%40mail.gmail.com.


[ansible-project] Regular Expression in ANSIBLE

2020-07-01 Thread Jenisha T
Hi
I have output from log file as below. I need to extract the string shown in 
bold. 

 Communication Diagnostic Report

---


User Name : username

Directory : /path/to/dir

Platform Architecture : Linux

Version : x.0.00.x

Host Name : abcdef1234

Logical Name : *abcdef1234*

Listen to Network Interface : *ANY


processes status

==

Listener : *Running as root * 


How to extract the value of Logical Name : *abcdef1234 *

from the multiline string. 


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/cbdb83e6-d7b4-42ec-8d23-408736d0aeb2n%40googlegroups.com.