Skip to main content
Documentation - HPE Consumption Analytics

Conditions in SmartTags rules

Conditions define which rows of collected data a SmartTags rule affects. For each condition, you select one or more fields in your collected data, and define how HPE Consumption Analytics platform should search those fields to find a match. If you specify no conditions, the rule is triggered for every row.

For information about the actions you can trigger with conditions, see Actions in SmartTags rules.

CAP_smarttags_rule_cond.PNG

Defining fields in a condition

Within a condition you can define one or more specific fields, and then specify whether the condition is met when Any or All of the specific field definitions are matched. For example, create a Field equals value condition that contains definitions for two fields. If you toggle Match to Any, then the condition is met where the specified value for either of the fields found in the collection data.  If you toggle Match to All, then the condition is met only where the specified values for both fields are found in the data.

Assume that our example Field equals value condition contains Fields Provider Region and VM SizeWhere Fields are equal to Values North America and Large, respectively, and Match is toggled to All. If the collected data has at least one North America value for the Provider Region field, but does not have at least one Large value for the VM Size field, then the condition is not met, and the rule's actions are not triggered.

When selecting fields, if the field you want does not exist, click Create New Field next to the Field drop-down list arrow to create a new field. 

For more information about fields, see Fields and field packages.

While a rule can have multiple conditions, it can have only one of each specific condition type.  For example, a rule can have only one Field exists value condition, though you can define multiple fields in that condition.

When you add a condition of a specific type, it is selected in the list of condition types. To remove the rule, clear the check box and click Delete.

If you define multiple condition types in a rule, they all must be met to trigger the rule.  For example, in addition to the Field equals value condition from the earlier example, you might create a Field contains value condition.  In that case, the rule's actions are triggered only if both conditions are met.

 

Condition types

You can define one or more of the following conditions in a SmartTags rule.

Field equals value

This condition triggers the rule when the field is either equal to or not equal to the specified value.

For example, you can trigger the rule when the collected data contains a specific Account ID:

CAP_smarttags_rule_cond_field_value.PNG

Field is empty

This condition triggers the rule when the field either has an empty string or does not have an empty string. For example, you can trigger the rule when the Account ID field has no value.

CAP_smarttags_rule_cond_field_empty.PNG

Field found in lookup

This condition triggers the rule when the value of the field in your collected data is found in the specified column of the specified lookup.  For example, you might have a lookup that lists Device IDs by Department. You can create a condition that triggers the rule when the value of the Device ID in your collected data matches the value in the Device ID column of your lookup.

CAP_smarttags_rule_cond_overlay.PNG

For more information about lookups, see Lookups.

Math expression is true

This condition triggers the rule when the mathematical expression you define is true. To add a field, click Field. To add a value, click Value. HPE Consumption Analytics platform validates your expression as you build it. If the expression is valid, the expression builder box turns green. If the expression is not valid, the expression builder box turns red and the number of errors display. 

For example, you can trigger a rule when the VM CPU Count field is less than 4 and the VM Memory GB field is greater than 8:

CAP_smarttags_rule_cond_field_math.PNG

Use the function button to:

  • Select a function that enables you to find the minimum value in a set of numbers and field values.
  • Select the maximum value in a set of numbers and field values.
  • Select round, round up, and round down field values from 0 to 8 decimal places.

 For example, you can create a function that finds the minimum of the number 4 and the value of the VM CPU Count field:

CAP_smarttags_rule_cond_field_math_fx.PNG

 

To nest an expression within an expression, use parentheses.

Field contains value

This condition triggers the rule when the field contains or does not contain a specified value. The value does not need to match exactly as with the Field equals value condition. For example, if you specify that the field must contain abc, the condition is met when the collected data for that field is abc, abc123, 123abc, and so on. Note you can toggle between case-sensitive and case-insensitive values.

For example, you can trigger the rule when the Account ID in your collection contains a given word, without regard to capitalization:

CAP_smarttags_rule_cond_field_contains.PNG

Fields are equal

This condition triggers the rule when the field is either equal to not or not equal to another specified field.

For example, you can trigger the rule when the Account Owner field matches the Name field:

CAP_smarttags_rule_cond_fields_equal.PNG

Field matches regular expression

This condition triggers the rule when the field matches the specified regular expression. For example, you can trigger the rule when leading spaces are found at the beginning of the Account ID field:

CAP_smarttags_rule_cond_field_expression.PNG