02-25-2013 04:33 AM - edited 03-04-2019 07:07 PM
I have a requirement to filter the next hop information from multiple route-map entries.
e.g. show route-map NAME | section sequence 10
Which gives me the output for sequence 10. I then want to match further to just get the next hop for that sequence so that I can programaically pull the information out.
Is there a way of using & logic at the CLI to make this happen?
Thanks
03-01-2013 05:22 AM
Hi Paolo
I have also searched for this option, but I was able find only opposite possibility.
show route-map NAME | section sequence 10
show route-map NAME | section sequence 10
show route-map NAME | section sequence 10
show route-map NAME | section sequence 10
show route-map NAME | section sequence 10
Router# show running-config | section include interface
interface Ethernet0/0
shutdown
no cdp enable
interface Ethernet1/0
shutdown
no cdp enable
interface Serial2/0
shutdown
no cdp enable
interface Serial3/0
shutdown
no cdp enable
This example show every line containing string "interface" and relevant section to that line. The possibility of filtering one line from particular section is not possible by common cisco ios command section filters. Maybe we could accomplish this by some "crazy" regexp it is not my piece of cake.
So if you (or anybody else) find some way how to do it, I will be grateful if you could share it with us.
Best Regards
Please rate helpful posts
03-03-2013 10:20 AM
Not really, because, unlike Linux or Windows cmd, you cannot string pipes together. You can use regular expressions, which sometimes give you what you want. For example, you could use:
show running-config | include ^route-map|next-hop
The first | symbol is a pipe to redirect the output, the second is part of a regular expression meaning "or". This would show you every line that started with "route-map" and every occurrence of "next-hop" which may be what you want or it may not be, based on your configuration.
Matt
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide