Update the Labels guide (#33144)

## For #29721

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
jacobshandling 2025-09-18 16:42:21 -07:00 committed by GitHub
parent 08b4eb73ec
commit a87d7bdc50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,47 +3,62 @@
![Managing labels in Fleet](../website/assets/images/articles/managing-labels-in-fleet-1600x900@2x.png)
Labels in Fleet provide a powerful way to scope profiles to specific hosts. This guide will walk you through managing labels using the Fleet web UI. Labels can be created dynamically using queries or manually by selecting specific hosts. Dynamic labels are applied to hosts that match the query criteria, while manual labels are assigned to hosts you select.
Labels in Fleet provide a powerful way to scope profiles to specific hosts. This guide will walk you
through managing labels using the Fleet web UI. Labels can be created manually by selecting specific
hosts or dynamically using queries or host vitals. Dynamic labels are applied to hosts that match
either the query
or the host vitals criteria, while manual labels are assigned to hosts you select.
### Accessing labels
### Managing labels
To access and manage labels in Fleet:
To access and manage labels in Fleet, navigate to the Labels page by clicking on the user menu at the top
right of the window, then selecting "Labels".
1. **Navigate to the Hosts page**: Click on the "Hosts" tab in the main navigation menu.
### Filtering hosts by label
2. **Filter by labels**: In the "Filter by platform or label" drop-down menu, you will see options for "Platforms" (e.g., macOS, Windows, Linux) and "Labels."
There are two ways to filter hosts by label:
You can add a new label, filter existing labels by name, or select a label from the list. Selecting a label filters the view only to show hosts with that label.
* **From the Labels page**: Hover over the row of the label whose hosts you want to see, select the
"Actions" menu, and select "View all hosts" from the dropdown.
* **From the Hosts page**: Select the "Filter by platform or
label" drop-down menu, then select the label you want to filter by.
### Adding a label
To add a new label:
1. **Navigate to the Hosts page**: Click on the "Hosts" tab in the main navigation menu.
2. **Access labels**: Click the "Filter by platform or label" drop-down.
3. **Select "Add Label +"**: This option allows you to create a new label.
4. **Enter a label name**: You may also provide an optional description for the label.
5. **Choose label type**: You will be prompted to choose between "Dynamic", "Manual" or "Host vitals" label creation.
1. **Dynamic**: Build your query and select the platforms to which this label applies.
2. **Manual**: Select the hosts to which you want to apply this label.
3. **Host vitals**: Select an attribute from the "Label criteria" dropdown, and enter a value that each host in the label should match for that attribute.
6. **Save the label**: Click the "Save" button to create your label.
1. **Access the new label form**:
* From the [Labels page](#managing-labels), click the "Add label" button, or
* From the Hosts page, select the "Filter by platform or label" drop-down menu, then select the "Add
label +" button.
2. **On the new label form**:
1. **Enter a label name**: You may also provide an optional description for the label.
2. **Choose label type**: You will be prompted to choose between "Dynamic", "Manual" or "Host vitals" label creation.
1. **Dynamic**: Build your query and select the platforms to which this label applies.
2. **Manual**: Select the hosts to which you want to apply this label.
3. **Host vitals**: Select an attribute from the "Label criteria" dropdown, and enter a value that each host in the label should match for that attribute.
3. **Save the label**: Click the "Save" button to create your label.
### Editing a label
To edit an existing label:
1. **Access the edit label form**:
* **From the Labels page**:
1. Hover over the row of the label you want to edit.
2. Select the "Actions" menu.
3. Select "Edit"
* **From the Hosts page**:
1. [Filter by the desired label](#filtering-hosts-by-label).
2. Click the pencil icon: A pencil icon will appear next to the label if it is editable. Clicking this icon allows you to edit the label.
2. **Edit the label details**: For manually applied labels, you can change the name, description,
and selected hosts. For dynamically applied labels, you can view the query. Host vitals labels
cannot be edited at this time.
1. **Locate the label**: Find the label you want to edit in the list.
2. **Click the pencil icon**: A pencil icon will appear next to the label if it is editable. Clicking this icon allows you to edit the label.
3. **Edit details**: For manually applied labels, you can change the name, description, and selected hosts. For dynamically applied labels, you can view the query. Host vitals labels cannot be edited at this time.
4. **Update restrictions**: To change the query or platforms a dynamic label targets, you must delete the existing label and create a new one. Once set, label queries and platforms are immutable.
> **Update restrictions**: To change the query or platforms a dynamic label targets, you must delete the existing label and create a new one. Once set, label queries and platforms are immutable.
### Using the REST API for Labels