mpenning / ciscoconfparse

Parse, Audit, Query, Build, and Modify Arista / Cisco / Juniper / Palo Alto / F5 configurations.
http://www.pennington.net/py/ciscoconfparse/
GNU General Public License v3.0
799 stars 220 forks source link

Parse output of show monitor-session status? #252

Closed chrisinmtown closed 2 years ago

chrisinmtown commented 2 years ago

Greetings, I'm a new user and hope I'm not mis-applying your tool. Please tell me if CCP can help me walk thru the output of a show monitor-session status command which yields output like below; please note this is basically empty output, no interfaces are operational:

#show monitor-session status
Monitor-session SOMETHING-10001
rx destination bundle interface Bundle-Ether10001.123 (down)
tx destination bundle interface Bundle-Ether10001.122 (down)
================================================================================
Source Interface      Dir   Status
--------------------- ----  ----------------------------------------------------

The constructor accepts this input text without complaint. I used the find_objects method with a linespec of tx which yields the tx line. Is there a smarter way to walk thru this output? I know this is not exactly config. Thanks in advance for hints!

mpenning commented 2 years ago

I know this is not exactly config.

That's a great place to start! CCP is most useful when parsing hierarchical text configs.

For this task, use genieparser or textfsm