Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
New Member

Cisco Prime - Configuration > Compliance > Baseline Templates - Regex

Hi,

it's been very hard for me to find good examples of advanced regular expressions that I may use in my Baseline Template (suggestions of websites would be appreciated):

I need to check if this line exists in my switches:

logging host 10.1.1.2

But old switches have this line (which is perfectly acceptable!)

logging 10.1.12

I have tried, in my baseline template, the following regex:

+[#logging.*10.1.1.2#]

It seemed to work fine, but if the device is NOT compliant, the report says that it will deploy the following command:

[#logging.*10.1.1.2#]

That's absurd! I don't want to deploy a regex.

How do I check compliance using regex and then deploy a different command (and not the regext itself)?

 

1 REPLY
New Member

I have this same issue and

I have this same issue and have decided to stick to a single command, so retrofitting all the switches was a necessary evil.  I created a template just for this command (I have multiple destinations) and my template looks like this:

-logging 10.1.1.2
+logging host 10.1.1.2

One thing I have noticed, that if you use the default settings, the template does not see that and will say non-compliant and then re-apply the command.  Example:

+logging facility local7 
+logging trap informational

will continue to report non-compliance and re-apply.


 

425
Views
0
Helpful
1
Replies
CreatePlease to create content