Configure Tag Rules

Define rules that automatically apply tags to devices based on their properties — re-evaluated on every inventory update.

Written By Stefan Steuer

Last updated About 1 month ago

Configure Tag Rules

Tag rules attach tags to devices automatically based on what each device looks like — its operating system, hostname pattern, customer, hardware, installed software, or any other property octoja inventories. Once you set a rule, octoja re-evaluates it on every inventory update so the tag follows the device as its state changes.

What are tags useful for?

Tags are short, lowercase labels (e.g. database, kiosk, vip) that you attach to devices. Anywhere octoja accepts a filter — config-package assignment rules, dashboard scopes, report templates, case scopes — you can filter by tag. Manual tagging is fast for a handful of devices; tag rules are how you tag at fleet scale without keeping a spreadsheet.

Example uses:

  • Workload tagging. Tag every device with the Microsoft SQL Server service running as database, then assign the SQL Server check bundle to tag = database.
  • Site-specific config. Tag every device whose hostname starts with BERLIN- as site-berlin, then deploy a German keyboard layout policy to it.
  • Compliance scope. Tag every Windows Server with a tag like pci-scope for fast filtering in audit reports.

Prerequisites

  • The Tag Rules permission (tags.manage), granted via groups under Administration → Groups — see Assign Permissions. Tag rules are configured in the admin area — if you do not see Administration → Tag Rules, ask an administrator to grant this permission.

Steps — Create a tag rule

  1. Go to Administration → Tag Rules.
  2. Click Add Tag Rule.
  3. Enter the Tag this rule applies. Lowercase letters, digits, and hyphens only (e.g. database, site-berlin, pci-scope).
  4. Click Add. octoja creates the tag rule with no conditions yet — every device will fail the rule until you add conditions.
  5. You land on the rule's detail page. Under Rules, define the conditions a device must satisfy for the tag to be applied. Optionally, click the description subtitle to add a short note explaining what the rule does, so the next admin understands why a device was tagged.

Defining conditions

Conditions are built from device properties octoja already inventories — operating system, customer, hostname, installed software, hardware. Within a single group, conditions are joined with and (every condition must be true). Add a second group to express OR (at least one group matches). Nest groups for more complex shapes:

  • One group, joined with and: OS family = Windows AND service "MSSQLSERVER" is running
  • Two groups, joined with OR: hostname starts with BERLIN- OR site = Berlin office

For very complex shapes, switch to Advanced editor to write the rule in octoja Query Language (OQL) directly. Nested groups can only be edited in advanced mode.

When does the tag appear?

Tag rules are evaluated on every inventory update. After you save a rule's conditions:

  • Devices that match get the tag the next time they push inventory.
  • Devices that stop matching (e.g. service stopped, hostname renamed) lose the tag on their next inventory update.
  • The Matched column on the Tag Rules list shows how many devices currently carry the tag.

Editing and deleting rules

Open a rule from the list to edit its conditions or description. Tag and tag-rule conditions update on every save — there is no separate "apply" step.

To remove a rule, scroll to the Danger Zone on the rule's detail page and click Delete Rule. octoja confirms how many devices currently carry the tag — deleting the rule removes the tag from every one of them, so review the count before confirming.

Tips

  • Tag names are lowercase, dashes, and digits only — pick descriptive names (workstation-finance beats wsf at the cost of a few extra characters).
  • Tags from rules and tags from manual edits live in the same namespace. Manually adding a tag to a device that also matches a rule keeps the tag stable; removing a rule still keeps any manually-added tag.
  • Use the Matched column on the list as a sanity check after a rule change — an unexpected drop suggests a condition is now too strict.
  • The keyboard shortcut Ctrl + N creates a new rule from the Tag Rules page.