> For the complete documentation index, see [llms.txt](https://docs.finout.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.finout.io/user-guide/inform/virtual-tags/custom-virtual-tags.md). Agents can also search and read this documentation through its [MCP server](https://docs.finout.io/~gitbook/mcp).

# Custom Virtual Tags

Custom Virtual Tags let you model cloud spend the way your business thinks about it, instead of the way each provider structures its billing data. You define rules that group cost by team, product, environment, customer, or any other business dimension, across all your clouds and services.

Once created, a Custom Virtual Tag is available everywhere in Finout, including [MegaBill](https://docs.finout.io/user-guide/inform/megabill.md), dashboards, and reports, so every widget and analysis uses the same allocation model.

## How a Custom Virtual Tag works

A Custom Virtual Tag is an ordered list of rules. Each rule has two parts:

* **Where** - the conditions a cost record must match, for example AWS · tag `team` · Is · `platform`.
* **Then** - the value the Virtual Tag assigns to every record that matches.

{% hint style="warning" %}
**Important**: Rule order sets priority. Finout evaluates Rule 1 first, and its value overrides all later rules. A record is evaluated against Rule 2 only if it doesn't match Rule 1, and so on.
{% endhint %}

Cost that matches no rule is grouped under **untagged**, which you can rename or map to a MegaBill key. A Virtual Tag can hold up to 1,000 rules.

## Create a Virtual Tag <a href="#h_7a4a4f8a04" id="h_7a4a4f8a04"></a>

To start from an existing Virtual Tag instead of from scratch, duplicate it. See [Manage Virtual Tags](https://docs.finout.io/user-guide/inform/virtual-tags/manage-virtual-tags.md).

1. In Finout, navigate to **Virtual Tags**.<br>

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FTfEg50U3hTkxzAcXeGsh%2Fimage.png?alt=media&amp;token=f68e1d98-29a3-424e-8aa8-0089727e9ccf" alt=""><figcaption></figcaption></figure>
2. Click **Create New** and then **Virtual Tag**.\
   The **Create virtual tag** page appears.<br>

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FLFZ4clkRTCtLP5oS0Dcd%2Fimage.png?alt=media&amp;token=d780f2b6-7984-4386-a1c4-b7491d735796" alt=""><figcaption></figcaption></figure>
3. Name the Virtual Tag.<br>

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FG9pAkxxrFXT2QJuM5KrA%2Fimage.png?alt=media&amp;token=53892fcb-4465-43f9-9c96-f3efe9cd474f" alt=""><figcaption></figcaption></figure>
4. (Optional) Choose an endpoint to notify about changes made to this Virtual Tag.<br>

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2Fl29YnPPhQzStI5JxIT6d%2Fimage.png?alt=media&amp;token=41db1297-36f6-4d80-a2f3-d5b30851fd56" alt=""><figcaption></figcaption></figure>
5. Build Rule 1: set the **Where** conditions and the **Then** value. See [Build a rule](#build-a-rule).
6. (Optional) Set a timeframe to apply the rule only between specific dates.<br>

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FhF2eHlR5S9wpaZk7y0gG%2Fimage.png?alt=media&amp;token=ce1852c3-805a-47b5-aabd-1621c4b710c6" alt=""><figcaption></figcaption></figure>
7. Click **Add rule** to add more rules. Order them from the most specific to the most general.<br>

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FrHFLaXDAI7bYCPHvmYPp%2Fimage.png?alt=media&amp;token=2ceafca1-1762-4da4-ac5a-fcb4a63f651d" alt=""><figcaption></figcaption></figure>
8. (Optional) In **Set the value for the untagged cost**, enter a custom name for the cost that matches no rule, or choose a MegaBill key to split that cost into multiple values. Use this to track what is still unallocated and add rules that reduce it.<br>

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2F2hFP09i2kKYnbRPbwuxU%2Fimage.png?alt=media&amp;token=6d928781-e930-4114-9734-9c7b55d3b278" alt=""><figcaption></figcaption></figure>
9. Click **Preview Virtual Tag** to check the result before saving.<br>

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FO76Pj0mzmjDWh4jHkmeT%2Fimage.png?alt=media&amp;token=45265fb6-06a1-42e0-a9b5-3bf06ed803b8" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FUCmJPwVf41ngGsfQZbCm%2Fimage.png?alt=media&amp;token=028b392a-9a1a-47a0-a752-c296294d1fd4" alt=""><figcaption></figcaption></figure>
10. Click **Create Virtual Tag**.\
    The **Save version** modal appears.<br>

    <figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FzBY6y6oTxOhRuGrR3u8Y%2Fimage.png?alt=media&amp;token=ad3f88d8-5880-4e10-a412-4e5e4544f046" alt=""><figcaption></figcaption></figure>
11. In the modal:
    * (Optional) Enter a **Change Description** of up to 280 characters. You can't edit it after the version is created.
    * Review the **Mark as Live** checkbox:
      * **Checked (default)** - this version becomes the Live version. It is immediately available for filtering and grouping across Finout.
      * **Unchecked** - the version is saved to the version timeline, and the Live version doesn't change. Use this to stage a configuration without affecting other users.
12. Click **Save**.\
    The Virtual Tag appears in the Virtual Tags list.

{% hint style="info" %}
**Note:** The Virtual Tag name and ACL permissions are not included in the version history. See [Virtual Tag Versions](https://docs.finout.io/user-guide/inform/virtual-tags/virtual-tag-versions.md).
{% endhint %}

## Build a rule

<figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FZwPk9Q1fNHtylBamN2Xv%2Fimage.png?alt=media&amp;token=65b6aedf-fee0-40ef-a628-d709e1544ac6" alt=""><figcaption></figcaption></figure>

### Where: define the conditions

1. Select a **cost center** from the MegaBill.
2. Select a **filter key**.
3. Select an **operator**: One of, Not one of, Is, Is not, Contains, Not contains, Exists, or Not exists.
4. Depending on the operator, select or enter one or more **filter values**.
5. To add another condition, click **+**, select **AND** or **OR**, and complete the new row. All conditions at the same level share one relation.
6. To combine AND and OR in the same rule, click **New group** to add a filter group. A filter group holds its own conditions and its own AND or OR relation, and the rule evaluates it as a single condition. A filter group can't contain another filter group.

### Then: set the value

Choose one of two options:

* **Custom Value** - type a static value for the cost that matches the rule, for example `Production`.
* **MegaBill Key** - select an existing field, such as a cloud provider tag, account name, or resource name. Its values become the values of the Virtual Tag.

<figure><img src="https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FKILTifWfMf8mBlAOEgNw%2Fimage.png?alt=media&amp;token=d80ac013-1e04-4c37-8c75-033664728ab3" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note**: When you select a MegaBill key, the key's values appear in the MegaBill when you filter or group by the Virtual Tag.
{% endhint %}

### Example: one rule across several cost centers

Rule 1 tags production cost across AWS, Azure, GCP, and Kubernetes. Each cost center names its environment differently, so the rule has one condition per cost center, joined by **OR**.

| Relation | Condition                                                    |
| -------- | ------------------------------------------------------------ |
| Where    | AWS · `environment` · One of · prod, production              |
| OR       | Azure · `environment` · One of · prod, production            |
| OR       | GCP · `env` · Is · production                                |
| OR       | Kubernetes · `label_environment` · One of · prod, production |

**Then**: Custom Value `Production`.

![A rule that tags production cost across four cost centers](https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2Fjucv4HnEoKJohbhMupS1%2Fvtag-rule-across-cost-centers.png?alt=media)

### Example: a rule with a filter group

The Platform team owns every resource tagged with its team name, and also the EC2 and Bedrock cost in its dedicated account, which isn't tagged.

| Relation          | Condition                                                                                            |
| ----------------- | ---------------------------------------------------------------------------------------------------- |
| Where             | AWS · tag `team` · Is · `platform`                                                                   |
| OR (filter group) | AWS · Account Name · Is · `platform-prod` **AND** AWS · Services · One of · AmazonEC2, AmazonBedrock |

**Then**: Custom Value `Platform`.

![A rule that combines AND and OR using a filter group](https://3858159242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWqjB2puKXPDR7L86FX2e%2Fuploads%2FM2VR5Dlz9BRwLonHB03r%2Fvtag-rule-with-group.png?alt=media)

Without the filter group, you would need two separate rules that assign the same value.

### Generate a rule with AI (Alpha)

Instead of building a rule manually, you can describe it in your own words: under the rule, click **Generate with AI**. For the full steps, see [AI Virtual Tags](https://docs.finout.io/user-guide/inform/virtual-tags/ai-virtual-tags-alpha.md).

{% hint style="info" %}
**Note:** AI-generated rules don't include filter groups. To combine AND and OR in a rule, add a filter group manually after the rule is generated.
{% endhint %}

## Next steps

* To edit, duplicate, or delete a Virtual Tag, or to set who can edit it, see [Manage Virtual Tags](https://docs.finout.io/user-guide/inform/virtual-tags/manage-virtual-tags.md).
* To review earlier configurations or restore one, see [Virtual Tag Versions](https://docs.finout.io/user-guide/inform/virtual-tags/virtual-tag-versions.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.finout.io/user-guide/inform/virtual-tags/custom-virtual-tags.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
