Custom Labels
Learn how Custom Labels in Ternary allow organizations to create business-relevant labels from cloud billing data using rules, templates, data mapping, and advanced matching logic.
Custom Labels in Ternary allow organizations to create new business relevant labels on top of existing cloud cost data. These labels are built using existing metadata such as cloud provider tags, resource labels, project identifiers, account identifiers, or other available attributes. This makes it possible to analyze billing data in a way that reflects how the business is structured and operated.
In practice, Custom Labels help teams:
- Define clear relationships between business units and cloud costs, such as mapping projects or accounts to cost centers or internal teamS
- Connect cloud resources to business operations by assigning labels for environments, departments, applications, or other internal categories
Once applied, Custom Labels allow cloud spend to be viewed and filtered using business aligned dimensions that may not exist in the original billing export. This adds meaningful context to reports and dashboards and improves transparency and accountability across finance and engineering teams.
What’s new with Ternary Custom Labels?
The latest version of Custom Labels introduces several enhancements that expand flexibility and improve usability:
- Ability to create entirely new label dimensions from any existing label, including outputs from previously created custom labels.
- Multiple creation methods, including pre-built templates for common use cases, bulk CSV uploads, and full manual configuration.
- Expanded matching capabilities such as wildcard pattern matching and regular expression support, now fully available in the user interface.
- Support for combining multiple conditions within a single rule and assigning multiple output labels in the same rule, simplifying complex mappings.
- Improved performance, with new labels typically becoming available in under an hour and often within minutes for smaller datasets.
- Updated user interface with draft and publish functionality, enabling both technical and non technical users to create, review, and manage custom label rules more efficiently.

Key Concepts of Ternary Custom Labels
Before creating custom labels, it is important to understand the core components of a Custom Label rule and how they work together.
Rule Title
Each custom label rule includes a descriptive Rule Title. This is not the label key itself, but a name used to identify the purpose of the rule, such as “Map Projects to Cost Centers.” Clear naming becomes important as the number of rules grows over time.
Conditions
Conditions define which cost line items the rule applies to. Each condition evaluates an existing key from billing data using a selected operator and value or pattern. All conditions within a rule must evaluate according to the selected logical structure for the rule to apply. Multiple conditions can be combined to target a specific subset of data, such as Account equals X and Region equals Y.
- Existing Label Key: It is the source field evaluated by the rule. Ternary automatically ingests keys from cloud billing data, including project tags, resource labels, project IDs, and account IDs. An existing Custom Label key can also be selected. This allows chaining, where the output of one custom label becomes the input for another. Key names must match exactly as they appear in the data.
- Operator: The operator defines how the key’s value is evaluated. Supported operators include:
- equals: Matches an exact string value
- pattern match: Supports wildcard matching using the asterisk character to represent any sequence of
- characters. For example, env* would match env, env-prod, or environment.
- regex matches: Uses a full regular expression pattern for advanced matching
- is set: Checks whether the key exists and contains a value
Operators can also be configured to negate a condition where required.
- Value or Pattern: This specifies what the key is compared against or a pattern if using wildcard/regex. For equals, one or multiple values can be selected. For pattern or regex matches, a valid pattern must be provided. For is set, no value is required.
Outputs
Outputs define which new labels are assigned to cost items that meet the rule’s conditions. A single rule can assign multiple custom labels simultaneously. Two output modes are supported:
- Direct Assignment: Define a new custom label key and value that will be applied to all matching items. Multiple direct assignments can be added within the same rule.
- Conditional Mapping: Assign output values based on the value of an existing field. In this mode, an existing key is selected and its values are mapped to corresponding new output values.
For conditional mapping with Value Based Labeling, mapping rows are evaluated in order, and the first matching row supplies the output value. Put more specific matches before broader ones. An optional Else provides the fallback; only one Else is allowed and it must be the last row.
For Label Grouping, which combines source keys into one label, source order also matters: the output uses the first selected source key present on the billing row. If several selected keys are present, later keys do not override the first one.

Draft and Published States
Custom Label rules can be saved as a draft before being made active. Saving as Draft allows the rule logic to be reviewed and refined without affecting billing data. Publishing activates the rule and applies it to eligible cost line items.
Processing and Propagation
After a rule is published, Ternary processes it against billing data. This processing typically completes within a few hours, though timing may vary depending on data volume. Once processing is complete, the newly created labels become available across the platform, including reports, dashboards, and filters.
The management table shows the rule’s processing state:
| State | Meaning |
|---|---|
| Draft | The rule is saved without processing billing data. |
| Processing | Publication or a definition change has started asynchronous processing. |
| Active | Processing has reported success. |
| Failed | Processing failed; a successful save did not complete label processing. |
| Inactive | The rule is inactive and is not available as a published prerequisite. |
A successful publish does not mean labels are immediately available in reports. Check the status after publishing.
Methods for Creating Custom Labels in Ternary
Ternary provides several ways to create Custom Labels depending on the level of control and scale required.

1. Using Pre Built Templates
Templates provide a guided setup for common labeling scenarios and reduce the need to configure rules from scratch. To use a template:
- Navigate to Custom Labels and select New Custom Label.
- Choose a relevant template such as Normalize Environment Labels.
- Fill in or adjust the predefined placeholders based on your requirements.
- Review the rule configuration and publish when ready.
Templates are useful for standard use cases where consistent logic is required across environments.
2. Data Mapping
Data Mapping allows bulk creation of labels using a structured CSV file or a BigQuery table. To use Data Mapping:
- Prepare a CSV file or BigQuery table containing the required mapping structure. An example template is available within the Data Mapping interface.
- Select either the CSV or BigQuery option in the Custom Labels workflow.
- Upload the file or reference the table and review the source rows and column assignments in the preview. Correct any format or configuration errors shown. The preview does not confirm matches against billing data.
- Submit the configuration and allow the system to process the labels.
This method is best suited for large scale mappings such as project to business unit or account to cost center relationships.

3. Manual Rule Creation
Manual setup provides full control over rule logic. To create a rule from scratch:
- Select New Custom Label and start with a blank rule.
- Enter a clear and descriptive Rule Title.
- Add one or more Conditions using the appropriate keys, operators, and values.
- Define Outputs using direct assignment or conditional mapping.
- Review the rule summary to confirm accuracy.
- Save as Draft or Publish the rule.
Manual configuration is recommended when complex logic or precise targeting is required.
Create a custom label from a suggestion
- Open Admin > Custom Labels, then AI Suggestions. Review an available suggestion, including its source keys and displayed confidence.
- Review the proposed name and output key. Edit them to describe the grouping you want to create. To inspect the source-key choices, open Select; cancel the chooser if you want to retain the existing keys.
- Select the suggestion using its checkbox. Review the selected definition before choosing Create Selected Labels. Editing a suggestion alone does not save a custom label.
- After the creation confirmation, find the new label in the Custom Labels list. It can initially show Processing; creation confirmation alone does not mean that processing has completed.
- Open the new label's Edit action to review the saved name, description, source keys and output key.
To remove a label you created and no longer need, use its row's Delete action. Review the Delete Custom Label confirmation. Choose Confirm to delete it. Deletion cannot be undone. After confirmation, check that the label is no longer listed. This procedure covers an unused label.
Using Custom Labels in Reports and Dashboards
Once published and processed, Custom Labels become available throughout the platform. They appear in grouping selectors within reports, dashboards, and other analysis views.
Custom Labels can be located by searching for the label name directly or by selecting the quick filter pill labeled Ternary, which displays all Custom Labels created within the tenant. This allows teams to immediately group, filter, and analyze cost data using newly defined business dimensions.

Managing and Editing Custom Labels
All Custom Label rules are managed from the Custom Labels admin page.
-
Viewing rules: All existing rules are listed in the management table for visibility and tracking.
-
Editing a rule: Select Edit to update conditions or outputs, then republish to apply changes. Changing only a rule’s name or description does not reprocess billing data. Changing a published rule’s definition starts processing again.
Some rules created through the API use condition trees that the visual editor cannot represent. You can still view and export these rules as JSON, but Edit is unavailable. The editor supports a single filter or a flat AND/OR group, including negated individual filters; it does not flatten deeper condition trees.
-
Deleting a rule: Removing a rule deletes the associated label from the platform. Deletion, deactivation or edits can be blocked by published custom-label prerequisites, applicable Billing Rules or Alert Rules that are not Inactive. Review the dependency result; names and links depend on your access.
-
Execution order and chained labels: When a Custom Label uses another Custom Label’s output, that prerequisite must run first. When custom-label dependencies are enabled, select the prerequisite published rules in the rule editor. The selector excludes the current rule and dependencies that would create a cycle. The management table does not provide drag-and-drop execution ordering.
Updated 17 days ago
