16 Apr 2021 08:26 AM - last edited on 22 Nov 2021 11:15 AM by MaciejNeumann
I am deploying auto-tag configuration like below
{
"description": null,
"name": "{{.name}}",
"rules": [
{
"conditions": [
{
"comparisonInfo": {
"negate": false,
"operator": "EQUALS",
"type": "ENTITY_ID",
"value": "HOST_GROUP-EFEB49"
},
"key": {
"attribute": "HOST_GROUP_ID"
}
}
],
"enabled": true,
"propagationTypes": [
"PROCESS_GROUP_TO_SERVICE"
],
"type": "PROCESS_GROUP",
"valueFormat": "{HostGroup:Name}"
}
}
is there a way to specify the name itself instead of meId.
Solved! Go to Solution.
16 Apr 2021 01:16 PM
Yes you can! I recommend doing it from the UI then pulling the Json of that rule. If I understand your question correctly, you would like to capture the Host Group, Dynamically, and set it as a tag, but only for entities assigned to a specific host group.
You will need to do the following:
Create a new Auto Tag rule and name it Host Group. Then add a rule for the host, process, or service, or all of them. and in the tag value you will put {HostGroup:Name}. This will grab the Host Group Value for the entity and put it into a tag. Then select what the rule applies to, and then isolate (if needed) the Host Group and such, and then set conditions. This will allow you to Narrow down the scope even more for the rule. If the Host Group Name Starts with or contains Easy Travel.
Click Preview and ensure that your desired entity shows up and then create and save the rule. then you're done. Then you can pull the rule via the API and use it as a template.
19 Apr 2021 12:57 PM
Hi @ChadTurner I am using json configuration to create tags using monaco so is there a way to specify name in ENTITY_ID because finding out host group id is difficult everytime
"type": ENTITY_ID
"value": host group name
19 Apr 2021 01:09 PM
Entity ID should be left blank when creating a new auto tag rule as dynatrace will assign its own ID for the rule. If you are looking to get the entity ID of a Host Group, then you'll need to click on one of the hosts and the Host Group its associated with. From there the Host Group ID is in your URL:
28 Apr 2021 09:50 AM
Thanks for the clarification.