[Solved] Cisco WLC filter for CDP data
Posted: Mon Mar 14, 2022 9:07 pm
Backing up a Cisco Wireless Lan Controller, part of the backup is a 'show CDP Neighbor' command. The holdtime output changes with each backup, I'd like to filter out (using ignore) these lines from the config backup.
I've tried a few regex expressions and none seem to work even tested with some online testers and able to match the entire string. I have other regex expressions that work just fine I even tried the 'starts with' and 'ends with' as a test and could not get any of them to work. One thing I did notice is that the output of the CDP command is all commented lines (start with !) for example:
! ******************** CDP NEIGHBOUR SUMMARY **********************
!
! Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
! S - Switch, H - Host, I - IGMP, r - Repeater,
! M - Remotely Managed Device
!
! Device ID Local Intrfce Holdtme Capability Platform Port ID
! device name
! Gig port number 170 R S I neighbor device name and port
! Gig port number 154 R S I neighbor device name and port
Could this be the issue in that the filter will not apply to commented lines even if you start the filter with the exclamation point check?
Thanks
I've tried a few regex expressions and none seem to work even tested with some online testers and able to match the entire string. I have other regex expressions that work just fine I even tried the 'starts with' and 'ends with' as a test and could not get any of them to work. One thing I did notice is that the output of the CDP command is all commented lines (start with !) for example:
! ******************** CDP NEIGHBOUR SUMMARY **********************
!
! Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
! S - Switch, H - Host, I - IGMP, r - Repeater,
! M - Remotely Managed Device
!
! Device ID Local Intrfce Holdtme Capability Platform Port ID
! device name
! Gig port number 170 R S I neighbor device name and port
! Gig port number 154 R S I neighbor device name and port
Could this be the issue in that the filter will not apply to commented lines even if you start the filter with the exclamation point check?
Thanks