label
Type: Function · Category: server
Add the labels to the client. If op is ‘remove’ then remove these labels.
Example
The following query sets the MyLabel label on all hosts that last
connected from an IP address matching the regular expression (You
can also do a CIDR check using the cidr_contains() function)
SELECT *, label(labels='MyLabel', op='set', client_id=client_id)
FROM clients() WHERE last_ip =~ "127.+"
| Argument | Type | Description |
|---|---|---|
client_id |
string (required) | Client ID to label. |
labels |
list of string (required) | A list of labels to apply |
op |
string | An operation on the labels (set, check, remove) |
Required permissions: LABEL_CLIENT
Platforms: macOS, Linux, Windows
Source: vql/server/labels.go