Document toolboxDocument toolbox

Using the Rule Logic Builder

The Rule Logic Builder provides an environment for creating rules by combining config file matches with logic to produce a result when the rule executes. Rule Logic consists of two primary building blocks:

  • Config File Match: a defined section of configuration file text of one or more lines, used during parsing of device configuration files to perform matching. Matching may be positive ('Must Contain') or negative ('May Not Contain');

  • Device Attributes: these consist of three smaller elements, including device attributes (see Adding Device Attributes to a Rule Filter for a list of attributes), mathematical and logical operators, and a value to match against.

At the top of the Rule Logic Builder panel, you see an Enforce This Rule field. Here, you use Boolean AND and OR operators to enforce the logic trail employed by the rule. For example, consider a rule that has three elements: two Config File Matches and a device attribute as the third element.

You enter Config File Matches and Device Attributes one at a time, in any order, in the logic builder. You cannot rearrange them after they are added to the block list; each block provides an Action menu through which you edit or delete each block.

To create a new rule using the Rule Logic Builder:

  1. Select the rule in the Rules panel.

  2. Select Rule Logic Builder in the Editor list in the upper right corner. (This list is inactive if you are editing an existing rule.)

  3. To add a config file match for a configuration command:

  4. Click Add Config File Match.

  5. (Optional) In the Edit File Match dialog, enter a Note describing the config file match.

  6. Open the list and select a must contain/may not contain option:

    • ALL of These Lines in Any Order

    • ALL of These Lines in Specified Order

    • AT LEAST ONE of These Lines

    • This BLOCK

    • This BLOCK Only Once

    • ONLY ONE of These Lines

  7. In the text field, type or paste in the config file match line or block (see references below for additional information).

  8. Click OK.

  9. To add a device attribute check, click the Add Device Attribute button.

    1. Choose a device attribute from the left dropdown list (see Adding Device Attributes to a Rule Filter for a list of choices).

    2. Select an operator from the center dropdown list.

    3. Enter a value in the right field.

    4. Click OK or select Apply and New.

  10. Click Add Config File Match or Add Device Attribute to add a new element to the block list.

  11. Click the Save button at the bottom of the page.

By default, config file matches are combined with logical ANDs; editing the Enforce This Rule field allows for Boolean ORs, NOTs, and If-Then-Else logic. Hover the mouse over the Info icon to the right of the field for details.

  • To view config file match details, click the (+) icon at the left end of the row.

  • To edit a config file match: hover the mouse over the Action icon for the element and choose Edit.

  • To delete a config file match: hover the mouse over the Action icon for the element and choose Delete.

When creating a rule to evaluate a block of config in a specified order, note that the “all of these lines in specified order” logic implies that each line is present and in that order, and there can be other lines in between. In this case, the rule passes. If you do not want to allow other lines in between, use the “Contains This BLOCK” option. Also, in both the “Config File Must Contain” and “Config File May Not Contain” sections, each entered line is considered a regular expression to be matched against the configuration file. If you select one of the BLOCK options, the entire content of the field is considered a regular expression.