label

Function

ArgDescriptionType
client_idClient ID to label.string (required)
labelsA list of labels to applylist of string (required)
opAn operation on the labels (set, check, remove)string

Required Permissions: LABEL_CLIENT

Description

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.+"