Datadog

Datadog Expertise

RapDev is a Datadog Premier Partner focused on accelerating our customers’ time to value.
600
Implementations
110
US-Based Engineers
68
Datadog Certifications

Security & Managed SOC

Quickly and seamlessly implement Cloud SIEM, ASM, SCA, and Cloud Security Posture Management to power a modern DevSecOps strategy

Incident Management

Transform data into high-confidence, actionable incidents using AI-driven detection, clear ownership models, and automated remediation

Marketplace Integrations

RapDev is proud to offer more Datadog Marketplace integrations than any other partner

ServiceNow

ServiceNow Expertise

RapDev is a ServiceNow Elite partner focused on helping you drive business outcomes with the ITx suite.
4.7
CSAT Score
136
Product Line Certs.
67k
AI Agents Discovered

Agentic AI & AI Governance

Deploy and scale production-ready agentic AI to automate workflows and accelerate ServiceNow outcomes

Enterprise Architecture

Connect your technology landscape to business strategy to optimize investments, reduce risk, and accelerate modernization

ServiceNow Store

Leverage RapDev’s certified apps and AI Agents to expedite operations on the Now Platform
Blog
Company

About RapDev

RapDev is powered by a team of experienced, U.S. based engineers focused on redefining service operations through AI, automation, and modern observability.

Join the RapDev team

Our no-frills approach to collaborating is what allows us to deliver the best. Our team is growing and we’re looking for the best in the game.

Press

Latest news and announcements from RapDev

Events & Webinars

From hands-on workshops to industry-leading conferences

Resources

Back to blog

Automate CI Tagging with Tag Generator

Automate Key-Value tagging for complete visibility in ServiceNow

X

min read

November 19, 2024

Jon Giara

Tag-Based Service Mapping is an efficient and useful way to map cloud and containerized applications. There is no need for additional applicative credentials and there is no need to create custom patterns in order to map the application, which is commonly the case when using traditional Top-Down Service Mapping. Discovery and Service Graph Connectors will bring CIs into your CMDB along with any tags, if the target resources have them. When a Tag-Based Application Service is created, a group of tags (i.e. key/value pairs) are designated for the service. ServiceNow then looks for all CIs that have this grouping of tags and adds them to the map. If those CIs have relationships to other CIs, those are also added to the map via traversal rules. This creates a useful visualization for the Application Service, where you can see what is ultimately affected upstream when a resource has an issue.

Overcoming Tagging Challenges with Tag Generator

Since this Service Mapping method uses tags, tags need to actually exist for the resources that you want to map. While ServiceNow Discovery and Service Graph Connectors import tags for virtualized environments when they exist, many organizations struggle with incomplete or inconsistent tagging strategies. Also, since physical devices can’t have tags because of their nature of being a physical device, these CIs can’t be added to the maps when you might want them to be. That’s where Tag Generator comes in. This application bridges the gap by enabling automated tagging for CIs that lack native tags. Tag Generator will automatically create tags in the same Key Value table that is utilized for Tag-Based Service Mapping based on definitions that you configure. It also includes a cleanup mechanism to automatically delete tags that are stale or no longer match your current definitions.

So how exactly do these Tag Generator Definitions work?

For each definition you must specify the key name for the tag you want to create, and also the CIs in question that you want to target for tag creation by choosing a CI class and respective filter conditions. There are three different methods in which the value of the tag can be populated: static values, regex on a CI field, and a script. 

For static values, you just need to provide the value and all CIs that match your filter will get the value specified.

For the regex method, you must define a regular expression with one capturing group and the field on the CIs that your regular expression will be applied against. Tags are only created for CIs where there is a valid match, and the resulting value of the capturing group is used for the tag value.

For the script method, you must return a string value. If the value is a valid string and not empty, that value is used for the tag value of the CI. You have access to the “current” CI GlideRecord object that is being processed.

For each definition, you can use the Preview Tag Values button to test out your logic to ensure your regex or script is working as intended.

You can also view what tags were generated via the definition by looking at the related list at the bottom of the definition form. 

By default, there is a scheduled job that executes daily that will process all Tag Generator Definitions. An individual definition can also be executed manually by going to the definition in question and clicking the “Execute Definition” related link. Each time a definition is processed, it will also delete tags - either because the definition is inactive or because the tag is stale, meaning that a valid tag value has not been found for the CI in the last X days. You can control how and when these tags are deleted by modifying the respective system properties.

Request Tag Generator today - it’s free!