Configuring rules

Rules help streamline topologies and conserve system resources, such as by merging different observer records of the same resource into a single composite resource, or by excluding specific changes from being recorded against a resource history.

Before you begin

Ensure that you have the details to hand about the resources for which you intend to develop rules. For example, to create merge rules, you must know which resources exist as duplicate records before you can merge these into composites.

About this task

Resource filters: Resource filters let you use resource properties to either include or exclude all resources with these properties from having a rule applied to them. You can add more than one property as a filter. Resource filters cannot be set for history or event rules.

Tokens: Rules copy the values of properties to a token. Tokens are sets of strings that behave in ways specific to each rule type. You can combine several properties into a single token by using ${propertyName}.

Token filters: An 'Include' token filter applies only to resources or groups having the listed tokens. You can use an 'Include' token filter simply to include (or exclude) specific properties, or extend its use with regular expressions to manipulate the input property.

Example use of tokens and token filters

Token Include token filter Input properties Single output token value
host host=example.ibm.com example.ibm.com
${host} host=example.ibm.com example.ibm.com
${host}location-${location} host=example.ibm.com,location=1 example.ibm.com location-1
host host=~/^(.?)/..$/ host=example.ibm.com example
${uniqueId}Location-x uniqueId=~/^.(.)$/ uniqueId=anything Location-X

Tip: See the Rules reference topic for additional information.

Rule types

You can use a number of different types of rules for different purposes. The rule type (ruleType) can be one the following rules.

Merge rules (mergeRule)

  • Define a merge rule to populate the mergeTokens of resources matched by the rule to prevent duplicate records of the same resource from being displayed in the topology.
  • A merge rule copies particular properties of a resource into the resource's mergeTokens property.

Match token rules (matchTokensRule)

  • Define a match tokens rule to copy the value of another field to the matchTokens field so that it can be used to match events to resources.
  • A match token rule populates the matchTokens of resources matched by the rule.

Tags rules (tagsRule)

  • Define a tags rule to copy the value of another field to the tags field so that it becomes searchable in the UI.

  • A tags rule populates the tags of resources matched by the rule.

    Tip: Any field that isn't indexed and can therefore not normally be searched for becomes searchable if copied to the tags property. For a list of indexed properties, see the 'Generic properties' table.

History rules (historyRule)

  • Define a history rule to identify properties that change every observation, but that don't indicate an important change, for example a host's sysUpTime property.
  • A history rule excludes properties from being retained in history, thereby saving resources by not maintaining detailed historical records of changes to these properties.

File enrichment rules

  • Define a file enrichment rule in order to enrich resources as they are loaded into the topology service database with their geographical location.

Events filter rules (eventsFilterRule)

  • Define an events filter rule to prevent status derived from observer jobs from generating events in the system.

Business criticality rules

  • Define a business criticality rule to copy a particular property of a resource into the resource's businessCriticality property, which is then used to create a business criticality rule.

Accessing the Rules administration page

  1. Log in to the IBM Cloud Pak for AIOps console.

  2. From the main navigation, expand Operate and click Topology viewer.

  3. From the topology navigation toolbar, expand Settings, click Topology configuration, and then open the Rules administration page.

  4. Select the appropriate rules tab.