05-30-2023 03:18 AM
Hi Guys,
Im doing some work in DNAC for the security advisories and im trying to match on Regex commands. Im running the following command
show running-config | include ip http server|secure|active
But the problem is the bottom flag up from the config.
no ip http server
no ip http secure-server
Is there a way i can run my command above but make it exclude the no ip http server etc...
Now i dont want to run show running-config | exclude ip http server|secure|active as this then starts to present the running config apart from them lines. The aim here is for no results to appear so i know only the http element is disabled... Hope this makes sense
Solved! Go to Solution.
05-30-2023 06:41 AM
Gotcha
This regular expression will pick up both the ip servers (and not the "no" versions) because of the starting ^ which effectivly says it must start with the characters "ip".^ip http (secure-)?server(\s)?$
05-30-2023 05:11 AM
Hi @Karl Wilson
Have you tried an exact match?
^no ip http server$
This regular expression basically says look for something that starts at the beginning of the line (^) has exactly whats in the middle and ends ($)
You may have to fiddle with a trailing space (\s)? will look for one or no single trailing space.
^no ip http server(\s)?$
Either will exclude the secure-server.
05-30-2023 06:02 AM
Thnaks for the reply Claudia. What i want to achieve is if the http server or https sever is running or not but ignore it if the no command is in the config. If the no command is present i would like it to ignore.
If you are familiar with the dnac security advisory you can scan to match a pattern.... If it finds a pattern it will flag a a match.
I want to be able to scan all for http but ignore if the no ip http is present if you get me
05-30-2023 06:04 AM
05-30-2023 06:41 AM
Gotcha
This regular expression will pick up both the ip servers (and not the "no" versions) because of the starting ^ which effectivly says it must start with the characters "ip".^ip http (secure-)?server(\s)?$
05-30-2023 07:59 AM
Perfect.... Thank you for that. Much appreciated.
10-18-2023 05:58 PM
Hi Wilson,
Im trying the same with DNAC, it is not showing the output as expected. I would appreciate it if you post it with steps how to do it by using DNAC.
10-26-2023 07:30 AM
Thats how i done it in the end.... The reason being if you have the no ip http server it shows with running the commands above... using the ^ function i can say it must start with... So basically iv'e excluded the no command with my lines
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide