ON THIS PAGE
replace-pattern
Usage
<rpc> <load-configuration> <!-- replace a pattern globally --> <configuration replace-pattern="pattern1" with="pattern2" [upto="n"]> </configuration> <!-- replace a pattern at a specific hierarchy level --> <configuration> <!-- opening tag for each parent element --> <level-or-object replace-pattern="pattern1" with="pattern2" [upto="n"]/> <!-- closing tag for each parent element --> </configuration> <!-- replace a pattern for an object that has an identifier --> <configuration> <!-- opening tag for each parent element --> <container-tag replace-pattern="pattern1" with="pattern2" [upto="n"]> <name>identifier</name> </container-tag> <!-- closing tag for each parent element --> </configuration> </load-configuration> </rpc>
Description
Replace a variable or identifier in the candidate configuration or open configuration database.
Junos OS replaces the pattern specified by the replace-pattern
attribute with the replacement pattern defined by the with
attribute.
The optional upto
attribute limits the number of objects replaced. The
placement of the attributes in the configuration data determines the scope of the
replacement.
Attributes
replace-pattern="pattern1" |
Text string or regular expression that defines the identifiers or values you want to match. |
with="pattern2" |
Text string or regular expression that replaces the identifiers and values located with pattern1. |
upto="n" |
Number of objects replaced. The value of n controls the total number of
objects that the device replaces in the configuration (not the total number of
times the pattern occurs). The device replaces objects at the same hierarchy
level (siblings) first. The device considers multiple occurrences of a pattern
within a given object as a single replacement. If you omit the
|
Release Information
Attribute introduced in Junos OS Release 15.1R1.