Defining Segments based on Tags

Hello Team

Im trying to define a segment in order to group all entities based on the tagName called app

the app tagname includes the application name,  please see screenshot below

as you can see when I click on preview the result is always 0,

is there anyway we can achieve that ? or this should be done in different way ?

bestregards,

Makrem

Hi Makrem,

1. For Classic Entities

For classic entities, you can use the following approach to extract and filter tags:

Variable:

fetch dt.entity.host
| expand tags
| fields tags
| dedup tags

Filter:

tags = "$tags"

2. For Grail-based Data (Logs, Metrics, and Events)

When tags are applied directly to a server (e.g., using oneagentctl), they appear on the entity in the format [Environment]Owner:<Value>.

In Grail-based data, this tag is automatically ingested as a dedicated attribute named “Owner”. This allows you to apply a direct filter within your segment as follows:

Owner = "$owner"

Note:

Please note that the two methods above do not work properly for Grail-based entities. This is because Grail-based entities have a different data structure for tag values compared to classic entities and record-level data (logs/metrics).

I’m still figuring out how to apply the segment using tags to grail-based entities.

Regards,

Firman