Tagging rule examples#

Route queries by user group using a fixed value#

Create a tagging rule that sets the tier tag to premium when the user belongs to the premium_users group:

Field

Value

Tag key

tier

Condition

system.identity.group equals premium_users

Action

Fixed value: premium

Then, create a routing rule that routes queries where tier equals premium to the premium-cluster cluster group.

Extract environment from application source tag#

Create a tagging rule that extracts the environment from an application-set source tag, such as prod-reporting or staging-etl:

Field

Value

Tag key

env

Condition

system.request.source matches regular expression ^(prod|staging)-.*

Action

Regular expression extraction from system.request.source with expression ^(prod|staging)-.*

The captured group (prod or staging) becomes the value of the env tag, which routing rules can then match against.