Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

Network Change & Configuration Management

Reply
Highlighted

ConfigBlockCheck and multi-line regular expressions

Techie
Posts: 15
2049     0

I'm writing a raw XML rule and I need to find blocks of text in device config files that are delimited by two consecutive lines at the beginning of the block and two consecutive lines at the end of the block. Is is possible to use multi-line regular expression patterns in the block-start and block-end attributes of the ConfigBlockCheck tag of a raw XML rule? Does anyone have a working example?

 

Here is what I'm looking for at the beginning of the block.

 

config vdom
edit vdom_name

 

Here is what I'm looking for at the end of the block

 

end

end

Highlighted

Re: ConfigBlockCheck and multi-line regular expressions

Adviser
Posts: 353
2049     0
Yes, I believe you can use something like /yourregex\nnextline/m, but I haven’t tried it.
Highlighted

Re: ConfigBlockCheck and multi-line regular expressions

Adviser
Posts: 423
2049     0

Did you get it working or still need some help?

Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh
Highlighted

Re: ConfigBlockCheck and multi-line regular expressions

Techie
Posts: 15
2049     0

I tried that. It did not work. Reading the XML schema documentation made me think it would work but it didn't. I don't know what else to try.

Highlighted

Re: ConfigBlockCheck and multi-line regular expressions

Adviser
Posts: 353
2049     0
Can you post a config snippet and the XML you are using (or even better a simplified version)? I just looked at the code and in theory this should work.
Showing results for 
Search instead for 
Do you mean 

Recommended for You