...
The following examples demonstrate how Loose mode evaluates input lines when using the Source contains condition type.
...
Condition 1:
| Code Block | ||
|---|---|---|
| ||
description LAN hostname R1 |
...
Although the order of the input lines differs from the source, both lines are present.
...
Condition 2:
| Code Block | ||
|---|---|---|
| ||
hostname R1 description WAN |
...
The Source matches regex condition type treats each input line as a separate regular expression. Loose mode requires each regex to match somewhere in the source, but the matches can occur in any order.
...
Condition 3:
| Code Block | ||
|---|---|---|
| ||
router ospf hostname R[0-9]+ |
...
This verifies that the device follows the R<number> hostname convention and has OSPF enabled. The two matches are independent, so their order does not matter.
...
Condition 4:
| Code Block | ||
|---|---|---|
| ||
router ospf hostname R[A-Z]+ |
...
The following examples demonstrate how Sequential mode evaluates input lines when using the Source contains condition type.
Example Input 5
Condition 5:
| Code Block | ||
|---|---|---|
| ||
interface Ethernet1 ip address 10.0.0.1/24 |
...
Both input lines appear in the source in the correct order. The "description Uplink" line between them is ignored.
...
Condition 6:
| Code Block | ||
|---|---|---|
| ||
ip address 10.0.0.1/24 interface Ethernet1 |
...
When using Source matches regex, each input line is treated as a separate regular expression. Sequential mode requires the regexes to match lines in the specified order, but additional lines may appear between the matches.
...
Condition 7:
| Code Block | ||
|---|---|---|
| ||
router ospf network [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/([0-9]+) area [0-9]+ |
...
This verifies that an OSPF network statement appears after the "router ospf" command. Other matching lines may appear between the two lines.
...
Condition 8:
| Code Block | ||
|---|---|---|
| ||
network [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/([0-9]+) area [0-9]+ router ospf |
...
The following examples demonstrate how Strict mode evaluates input lines when using the Source contains condition type.Example Input 9
Condition 9:
| Code Block | ||
|---|---|---|
| ||
interface Ethernet1 description Uplink ip address 10.0.0.1/24 |
...
All three lines appear consecutively in the source.
...
Condition 10:
| Code Block | ||
|---|---|---|
| ||
interface Ethernet1 ip address 10.0.0.1/24 |
...
When using Source matches regex, each input line is treated as a separate regular expression. Strict mode requires the regexes to match consecutive lines in the specified order.
...
Condition 11:
| Code Block | ||
|---|---|---|
| ||
interface Loopback[0-9]+ description Management Loopback ip address 10\.255\.255\.[0-9]+ 255\.255\.255\.255 |
...
This verifies that a Loopback interface with a variable interface number has the required "Management Loopback" description and uses a /32 address from the 10.255.255.0/24 management subnet.
...
Condition 12:
| Code Block | ||
|---|---|---|
| ||
interface Loopback[0-9]+ ip address 10\.255\.255\.[0-9]+ 255\.255\.255\.255 |
...