Discussion:
[rancid] Ignoring certain output in diffs
Ben Sanders
2014-09-10 13:52:34 UTC
Permalink
Good Day,

I am struggling trying to create a way to ignore lines in diff. I have Patton devices which I am using the Cisco module for as it seems to grab the configuration. Problem is every time you "show run" it generates a timestamp:

example:
#----------------------------------------------------------------#
# #
# SN4980/1E24V #
# R6.6 2014-07-11 H323 RBS SIP #
# 2014-09-10T09:50:34 #
# SN/xxxxxxxxxx #
# Generated configuration file #
# #
#----------------------------------------------------------------#


Could someone lend a hand in ignoring the timestamp line??

Thanks.
Hughes, Doug
2014-09-10 14:26:07 UTC
Permalink
It's a bit of an FAQ.. Find the command callback in the crancid file for the command you are looking for.. (e.g. sub ShowVersion)

Scroll down to the main while loop therein. Find a 'next if' line

Add your own 'next if' line above or below that that will skip the thing you don't want.
e.g. next if (/^# 20[0-9][0-9]-[01][0-9]-[0-2][0-9]T/);

that'll match the thing you posted below and skip that date matching the regular expression.


From: Rancid-discuss [mailto:rancid-discuss-***@shrubbery.net] On Behalf Of Ben Sanders
Sent: Wednesday, September 10, 2014 9:53 AM
To: rancid-***@shrubbery.net
Subject: [rancid] Ignoring certain output in diffs

Good Day,

I am struggling trying to create a way to ignore lines in diff. I have Patton devices which I am using the Cisco module for as it seems to grab the configuration. Problem is every time you "show run" it generates a timestamp:

example:
#----------------------------------------------------------------#
# #
# SN4980/1E24V #
# R6.6 2014-07-11 H323 RBS SIP #
# 2014-09-10T09:50:34 #
# SN/xxxxxxxxxx #
# Generated configuration file #
# #
#----------------------------------------------------------------#


Could someone lend a hand in ignoring the timestamp line??

Thanks.

Loading...