Set Tags action
Available for alert and incident workflows |
This action constructs new tag values based upon templates. The specified output tag is then replaced by the new tag values. To instead add tag values to a specified output tag, use Add Item to List.
This action takes the following inputs:
Tag Value Templates
The template for defining the new tag value and the output tag that holds the value. Templates can refer to other fields and tags using
${property_name}
syntax. This action supports macros using${macro_name(property_name)}
syntax. The same template can reference multiple fields and tags.
Alert example
Suppose you are setting up data ingestion. You want to keep and shorten the names of some of the details
tag fields ingested from one of your monitoring sources, and drop the others. You can accomplish this with a workflow Trigger, a Set Tags action, and a Remove Tags action.
Set up the workflow trigger to activate on New or changed alerts (select Changes from anywhere), and add a filter for your monitoring source.
Add the Set Tags action. Under Tag Value Templates, enter the following for the input template and output field:
Input
Output
${tags.details_ip_address}
tags.ip_address
${tags.details_instance_id}
tags.instance_id
Add a Remove Tags action to drop all of the
details
tags. Under Include, choose Exclude, and under Regex Patterns enterdetails_.+
.
Here is an example alert processed by this workflow:
Alert before | Alert after |
---|---|
{ ... "tags": { "details_ip_address": "172.31.63.96", "details_instance_id": "i-a444f2c467643b047", "details_sysdet": "XXA-105", "details_cid": "519fa552" } } | { ... "tags": { "ip_address": "172.31.63.96", "instance_id": "i-a444f2c467643b047" } } |
Incident example
Suppose that for all new incidents with a certain source, you want to replace the value of the server
tag with "USW3". You can accomplish this by creating an incident workflow with Trigger and Set Tags actions.
Set up the workflow trigger to activate the workflow on incidents matching the preferred source.
Add the Set Tags action. Under Tag Value Templates, enter the following for the input template and output field:
Input
Output
USW3
tags.server
Here is an example incident processed by this workflow:
Incident before | Incident after |
---|---|
{ ... "tags": { "server": "USE1" } } | { ... "tags": { "server": "USW3" } } |