Khurram Khan
2013-02-20 10:17:51 UTC
Hello All,
I've been lurking around the mailing list trying to find a solution to my
issue. I'm trying to grab configuration from a Cisco ASR5000 which contains
the configuration in the form of:
spi remote-address 192.168.3.50 spi-number 256 encrypted secret
ba8533de9d50051d04c124ccebb16563 description "REMOTE-1"
Regex is not one of my forte's , and so far I've got the following to
remove the encrypted key from the configuration which doesn't seem to be
working
if (/(\s+spi remote-address (.*) spi-number (.*) encrypted secret .*
description .* )/ && $filter_pwds >= 1) {
ProcessHistory("ADMIN","","","#spi remote-address $1 spi-number
$2 encrypted secret <removed> description $4 $5\n");
next;
}
the result that I get in the configuration looks like:
#spi remote-address spi remote-address 192.168.3.50 spi-number 256
encrypted secret ba8533de9d50051d04c124ccebb16563 description "REMOTE-1"
spi-number encrypted secret <removed> description
i'm pretty sure i'm missing something in regex. If someone could point me
in the right direction, I would really appreciate it.
Thank you in advance!
I've been lurking around the mailing list trying to find a solution to my
issue. I'm trying to grab configuration from a Cisco ASR5000 which contains
the configuration in the form of:
spi remote-address 192.168.3.50 spi-number 256 encrypted secret
ba8533de9d50051d04c124ccebb16563 description "REMOTE-1"
Regex is not one of my forte's , and so far I've got the following to
remove the encrypted key from the configuration which doesn't seem to be
working
if (/(\s+spi remote-address (.*) spi-number (.*) encrypted secret .*
description .* )/ && $filter_pwds >= 1) {
ProcessHistory("ADMIN","","","#spi remote-address $1 spi-number
$2 encrypted secret <removed> description $4 $5\n");
next;
}
the result that I get in the configuration looks like:
#spi remote-address spi remote-address 192.168.3.50 spi-number 256
encrypted secret ba8533de9d50051d04c124ccebb16563 description "REMOTE-1"
spi-number encrypted secret <removed> description
i'm pretty sure i'm missing something in regex. If someone could point me
in the right direction, I would really appreciate it.
Thank you in advance!