I am trying to figure out how to use the matching function to filter just to entries that have admin-state set to enabled. I have tried to follow the examples in the manuals but they are not exactly the same format as the current cli and it refuses almost everything I enter seeming to give a syntax error to anything when using the pipe and match-any for example. How would I construct a cli command that only displays entries with admin-state enabled?
I have a dataset that looks like this:
MDS1-ESUA# show running-config tolt interfaces net config admin-state
tolt interfaces net config NET1
admin-state enabled
!
tolt interfaces net config NET2
admin-state enabled
!
tolt interfaces net config NET3
admin-state disabled
!
Hi,
I think you should be able to do:
show running-config told interfaces net config | tab | include enabled
I didn’t set up that data, but for a different example:
# show running-config sys routes inet route
sys routes inet route 1.0.0.1 24
description route0
enabled
type next-hop
next-hop 1.0.0.1
metric 100
!
!
sys routes inet route 1.0.0.2 24
description route1
enabled
type next-hop
next-hop 1.0.0.2
metric 100
!
!
then:
# show running-config sys routes inet route | tab | include 1.0.0.2
1.0.0.2 24 - route1 true next-hop 1.0.0.2 100
or without the table:
# show running-config sys routes inet route | include 1.0.0.2 | extended
sys routes inet route 1.0.0.2 24
next-hop 1.0.0.2
I believe the syntax must have changed since the original documentation. From what I can infer, it appears that you mostly only specify filters on the left side of the pipe symbol, then the match-all, match-any applies to whether you want to allow all or only some of the filters to match. From what I can see, it seems to work similar to the NETCONF filters.
As an example, I could find all the enabled interfaces as follows, I just omitted the index and applied a filter one level below the index, If I had added multiple filters then the match-any/all would apply. From the documentation, it seems like the filter used to be on the right hand side of the pipe:
MDS1-ESUA# show running-config tolt interfaces net config admin-state “enabled”
tolt interfaces net config NET1
interface-type uplink
admin-state enabled
uplink aid LAG1
uplink ports [ SFP1-1-1 SFP1-1-2 SFP1-1-3 SFP1-1-4 ]
uplink description “10G SFP Net Interface”
uplink enable-pause-frames false
uplink lag-speed e-autodetect
uplink hash-algorithm e-src-dst-mac
uplink pvid 101
uplink pvid-priority 0
uplink lacp-config admin-state disabled
uplink lacp-config lacp-mode active
uplink lacp-config lacp-timer short
!
tolt interfaces net config NET2
interface-type uplink
admin-state enabled
uplink aid LAG2
uplink ports [ QSFP1-2-1 QSFP1-2-2 QSFP1-2-3 QSFP1-2-4 ]
uplink description “40G QSFP Net Interface”
uplink enable-pause-frames false
uplink lag-speed e-autodetect
uplink hash-algorithm e-src-dst-mac
uplink pvid 102
uplink pvid-priority 0
uplink lacp-config admin-state disabled
uplink lacp-config lacp-mode active
uplink lacp-config lacp-timer short
!