Subject field compliance scenarios


The Grammar tab of the Add Rule, Edit Rule, or Copy Rule pages contains a Subject field that is used to define what to search for in a configuration. Selecting the Lines and Patterns values in this field enables you to search for multiple items in the configuration, and the AND and OR options allow you to determine whether all of the items in the Lines or Patterns field must be found in the configuration (the AND option) or finding any of the items in the Lines or Patterns field (the OR option) indicates a subject match. If there is a subject match, the value of the Subject Frequency field determines whether a compliance violation is triggered. See Defining-rule-grammar for more information.

This topic contains scenarios that illustrate how the selecting of the AND and OR options for the Subject field and the value of the Subject Frequency field determine whether a configuration is found to be compliant with a rule.

Scenario 1

In the first scenario, the Domain is set to the entire configuration, the Subject field is set to search for items A, B, and C (the AND option is selected), and the Subject Frequency field is set to Do not appear. The configuration contains items A and B. With the AND option selected, The referenced document [xwiki:Automation-DevSecOps.Network-Automation.TrueSight-Network-Automation.tsna251.TrueSight Network Automation 25\.1._Inclusion-Library._Common-terminology.WebHome] was not found. checks for all of the items appearing in the configuration. In this scenario, the configuration has items A and B, but item C is absent. This results in no subject matches being found. Since the Subject Frequency field is set to Do not appear, the configuration is found to be compliant with the rule.

Scenario 2

In the second scenario, the Domain is set to the entire configuration, the Subject field is set to search for items A, B, or C (the OR option is selected), and the Subject Frequency field is set to Do not appear. The configuration contains items A and B. With the OR option selected, The referenced document [xwiki:Automation-DevSecOps.Network-Automation.TrueSight-Network-Automation.tsna251.TrueSight Network Automation 25\.1._Inclusion-Library._Common-terminology.WebHome] was not found. checks for any of the items appearing in the configuration. In this scenario, the configuration has items A and B. This results in one subject match being found. Since the Subject Frequency field is set to Do not appear, the configuration is out of compliance with the rule, and a compliance violation is triggered.

Scenario compliance matrix

The following table shows all of the possible compliance scenarios, and whether the configuration would be found to be compliant with the rule.

Subject lines  

Configuration

Subject matches  

Rule compliance  

Subject Frequency is set to Do not appear

{A&B&C}

{A,B,C}

1

False

{A&B&C}

{A,B}

0

True

{A&B&C}

{D,E,F}

0

True

{A|B|C}

{A,B,C}

1

False

{A|B|C}

{A,B}

1

False

{A|B|C}

{D,E,F}

0

True

Subject Frequency is set to Appears exactly once (1)

{A&B&C}

{A,B,C,A,B,C}

2

False

{A&B&C}

{A,B,C,A,B}

1

True

{A&B&C}

{A,A,B,B,A}

0

False

{A&B&C}

{A,D,E,F}

0

False

{A|B|C}

{A,B,C,A,B,C}

2

False

{A|B|C}

{A,B,C,A,B}

2

False

{A|B|C}

{A,A,A,A,A}

5

False

{A|B|C}

{A,D,E,F}

1

True

Subject Frequency is set to Appears at least once (1..*)

{A&B&C}

{A,B,C,A,B,C}

2

True

{A&B&C}

{A,B,C,A,B}

1

True

{A&B&C}

{A,A,A,A,A}

0

False

{A&B&C}

{A,D,E,F}

0

False

{A|B|C}

{A,B,C,A,B,C}

2

True

{A|B|C}

{A,B,C,A,B}

2

True

{A|B|C}

{A,A,A,A,A}

5

True

{A|B|C}

{A,D,E,F}

1

True

{A|B|C}

{D,E,F}

0

False

{A|B|C}

{A,B}

1

True

|

Subject Frequency is set to Appears at most once (0..1)

|

{A&B&C}

|

{A,B,C,A,B,C}

|

2

|

False

|

{A&B&C}

|

{A,B,C,A,B}

|

1

|

True

|

{A&B&C}

|

{A,A,A,A,A}

|

0

|

True

|

{A&B&C}

|

{A,D,E,F}

|

0

|

True

|

{A|B|C}

|

{A,B,C,A,B,C}

|

2

|

False

|

{A|B|C}

|

{A,B,C,A,B}

|

2

|

False

|

{A|B|C}

|

{A,A,A,A,A}

|

5

|

False

|

{A|B|C}

|

{A,D,E,F}

|

1

|

True

|

{A|B|C}

|

{D,E,F}

|

0

|

True

{A|B|C}

{A,B}

1

True

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*