[Solved] Cisco WLC filter for CDP data

Unimus support forum
Post Reply
abjr
Posts: 4
Joined: Mon Mar 14, 2022 8:54 pm

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
abjr
Posts: 4
Joined: Mon Mar 14, 2022 8:54 pm

Tue Mar 15, 2022 9:04 pm

Made some progress, figured out the the what was causing the issue. The show CDP neighbor command output is in a table there are extra spaces that needed to be accounted for in the regex. What caused me confusion was that I was using the output from the diff view to use as string to base the regex on. I had to open a single backup view to see the actual formatting and spaces that were in the backup so that I could adjust the regex accordingly.

So now I have the filtering all setup but I'll still getting the notification emails of the config change with the filter text as what has changed. Shouldn't these no longer be part of the change email?
User avatar
Tomas
Posts: 1206
Joined: Sat Jun 25, 2016 12:33 pm

Wed Mar 16, 2022 12:42 am

abjr wrote:
Tue Mar 15, 2022 9:04 pm
So now I have the filtering all setup but I'll still getting the notification emails of the config change with the filter text as what has changed. Shouldn't these no longer be part of the change email?
If something triggers a change and the "<filtered>" lines are in the context for example, they would still be included. The filtered lines will NOT however trigger a change themselves.

So if you are still getting change notifications, something else (some other change) is still triggering a new changepoint. Could you please post a screenshot of the diff you get after adding the filters?
abjr
Posts: 4
Joined: Mon Mar 14, 2022 8:54 pm

Wed Mar 16, 2022 11:42 am

All is good now. Thanks for helping out. In the end I'd say my issue was just understanding how Unimus worked. Once I figured out the that I needed to account for the extra spaces in the regex and then when the next backup ran no email notifications were sent. The previous notification was sent because of the single non-filtered-captured line but did show all the changes, again that is what threw me off. But makes total sense now that I think about it.
Post Reply