Skip to main content
Solved

How to get the complete output of Show Command to a variable retrieved by a parser ?

  • October 14, 2021
  • 1 reply
  • 112 views

pradeep.gaddameedi
Forum|alt.badge.img

I would like to perform parsing programmatically. So, what I want is to get the complete output of a “show command”/”snmp query” to a parser variable. Please help. 

Best answer by Rakesh Mandava

I can see two ways to get this done. One way is with simple parser and the other one is with Advanced Parser.

 

1) Normal Parser with mregex as shown below. This method gives the total output of a show command into a variable as string.

 

2) Advanced Parser with "Script" Parsing method. Use _original_result in ParseText function as shown below. Define your variables and parse content into them. Then make a dictionary with interesting/desired values and return the dictionary.

 

 

Hope this is helpful to you !!

View original
Did this topic help you find an answer to your question?

Rakesh Mandava
Forum|alt.badge.img+1

I can see two ways to get this done. One way is with simple parser and the other one is with Advanced Parser.

 

1) Normal Parser with mregex as shown below. This method gives the total output of a show command into a variable as string.

 

2) Advanced Parser with "Script" Parsing method. Use _original_result in ParseText function as shown below. Define your variables and parse content into them. Then make a dictionary with interesting/desired values and return the dictionary.

 

 

Hope this is helpful to you !!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings