Skip to content

Commit

Permalink
Update client metadata descriptions in VQL ref
Browse files Browse the repository at this point in the history
  • Loading branch information
predictiple committed Dec 30, 2024
1 parent d4b8d04 commit 8f1e8de
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions docs/references/vql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,11 @@
Client metadata is a set of free form key/value data. Artifacts
may use this metdata or it may simply be used as part of your IR
processes.
### See also
- [client_set_metadata]({{< ref "/vql_reference/server/client_set_metadata/" >}}):
Sets client metadata.
type: Function
args:
- name: client_id
Expand All @@ -916,18 +921,25 @@
description: |
Sets client metadata.
Client metadata is a set of free form key/value data (see
client_metadata() function).
Client metadata is a set of free form key-value pairs, i.e. a dict.
For existing keys, the value is overwritten. Setting a metadata
key with a `NULL` value deletes that entry.
When updating metadata the result is the same as adding 2 dicts.
For existing keys, the value is overwritten.
Setting a metadata key with a `NULL` value deletes that entry.
### Example
```vql
SELECT client_set_metadata(ClientId="C.1234", Foo="Bar")
FROM scope()
SELECT client_set_metadata(client_id=client_id, metadata=dict(department="Lab02"))
FROM clients()
WHERE os_info.hostname =~ "TRAINING"
```
### See also
- [client_metadata]({{< ref "/vql_reference/server/client_metadata/" >}}):
Returns client metadata from the datastore.
type: Function
args:
- name: client_id
Expand Down

0 comments on commit 8f1e8de

Please sign in to comment.