Cloud Cruiser became HPE Consumption Analytics on Nov. 1st. You'll still see the old name in places while we update this site.

 

 

Consumption Analytics Documentation

Home > HPE Consumption Analytics Portal > Configuring the HPE Consumption Analytics Portal > SmartTags > Actions in SmartTags rules

Actions in SmartTags rules

Actions modify the rows of data that triggered a SmartTags rule. For each action, you select one or more fields to be modified.

For information about the conditions that trigger actions, see Conditions in SmartTags rules.

Defining fields in an action

Within an action you can define one or more specific fields. When the action is triggered, all fields defined in your action are modified. If a field you want modified does not already exist in your collected data, click Create New Field (addField.png) next to the Field drop-down list. In the following example, Cloud Cruiser performs both actions when the rule is triggered.

You can define multiple actions for a rule, but only one of any specific type. For example, you can define only one Truncate field action in a rule, that action can truncate one or more fields. By default, each action has only one field defined. To add another field to an action, click Add New.

To delete or edit the action, clear the check box and then click Delete.

Video example

The following video shows you how to create actions for SmartTags rules:

Action types

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

Truncate field

This action truncates the values of the specified field to the specified length. You can truncate only tag fields and fields you add manually to HPE Consumption Analytics Portal. You cannot truncate fields collected from your data sources. For example, if you added a location field, you could create an action that truncates its values to 20 characters. For more information about fields, see Field and field packages

Split field

This action creates new sequentially-numbered fields by splitting the value of an existing field by specified delimiters. For example, you can split the Account Owner field into First Name and Last Name fields.

Set field to value

This action sets the value of the specified field to a constant value. For example, you can set the value of a field to Unknown after a condition that triggers when that field contains no value.

Set field from fields

This action sets the value of a new or existing field. The value is constructed from the values of one or more source fields. For example, you could extract the first three characters of the Name field, and put that value in a new Domain field.

To view more options, click Advanced View. In the Advanced View section, you can: 

Field Description
Target Field Select the target field you want to extract information from. For example, Department Name.
Prefix Enter the prefix you want to add. For example, in the image above old is added to the beginning of the new field. 
Source Field Select the source field you want to use to populate the target field. For example, Business unit.
Start Position Select the start position, for example, 1.
Length Select the length of characters to use. 
Padding Type

Select the padding type you want to add to the field: 

  • None - No padding.
  • Leading - Padding before the field to achieve a specific length.
  • Trailing - Padding at the end of the field to achieve a specific length.
Padding Character

Enter the padding character, for example, space or dash characters.

Source RegEx

Enter the regular expression you want to use. For example:

.*resourceGroups\/(.*)\/providers.*

You must:

  • Include a group to extract a value from the Input Field. The group is used to extract the data from the Input Field.
  • Enter the Start Position and Length values to extract the resulting value after the regular expression is performed.
  • Set the Length value to zero to use all of the extracted regular expression capture group.
Suffix Enter the suffix to add to the end of the field.

To return, click Simple View.

Set field from lookup

This action finds the value of a source field in a lookup, and sets the value of a new or existing target field to the target value in the lookup. For example, if you have the Department Name field in your collected data, and you want to add the associated Business Units for those departments, a rule could find the department in a lookup containing the mapped values, and then set a field to the corresponding Business Unit.

To find and retrieve data from a lookup, enter the following information:

Field Description
Lookup Field The starting point in your collected data. For example, {prod_ccs}} might have collected the Department Name field from your Azure cloud.
Select a lookup table The name of the lookup containing the mapped value you want to retrieve. For example, the Department to BU lookup maps all departments to their business units using 2 columns, Department and BU.
Search Column The column in the lookup you want to search for the Lookup Field you specified. This field is used as a key to associate rows in your collected data with rows in the lookup. For example, since you have departments in your collected data, select the Department column from your lookup.
Value Column The column in the lookup containing the mapped value you want to retrieve. For example, the lookup has business units listed in the BU column. For each Department Name value in your collected data that has a matching value in the Department column of your lookup, HPE Consumption Analytics Portal will retrieve the corresponding value from in the BU column of your lookup.
Update Value in Field The field in HPE Consumption Analytics Portal to update with the value retrieved from the lookup. For example, you might want values from the BU column entered into your data in a Business Unit field. If this field does not already exist, click Create New field to create a new field.
If lookup is not found Toggle between Do not set and Set to Default. Set to Default requires a default number. 

For more information about lookups, see Lookups.

 

Convert field to lower/upper/title case

This action converts the case of the specified field to either upper case, lower case, or title case. For example, you might want to use all capital letters for the Cost Center field.

Set field to calculation

This action sets the specified integer field to a value determined my a mathematical expression you build. Cloud Cruiser 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, as a simple calculation you could convert MB to GB by setting the value of a GB field to an expression based on a MB field.

To add numbers, click the Value button. To add integer fields, click the Field button.

Use the function menu ( Function_icon.png ) 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 might want your calculation to include a Rate value that is no greater than 30. To do this, from the function menu:

  1. Select min(1,2,3,...). The function dialog box appears.
  2. Click Field and then select Rate.
  3. Click Value and enter 30. This creates a set of values that includes 30 and all values collected for the Rate field. The calculation will use the minimum value from that set.

To nest an expression within an expression, use parentheses.

 

Last modified

Tags

Classifications

This page has no classifications.
© Copyright 2018 Hewlett Packard Enterprise Development LP