3.2.6.2.3. Tag/Untag Assets Found In Query¶
This does the following:
Tag or untag assets fround in query results using –tag and –untag
# Show number of assets currently tagged with 'unmanaged'
$ axonshell devices count --query '(labels == regex("unmanaged", "i"))'
# Tag assets in query
$ axonshell devices get-by-saved-query --name 'Unmanaged Devices' --tag 'unmanaged'
# Show new count of assets tagged with 'unmanaged'
axonshell devices count --query '(labels == regex("unmanaged", "i"))'
# Untag assets in query
$ axonshell devices get-by-saved-query --name 'Unmanaged Devices' --untag 'unmanaged'
# Show count with no assets tagged again
axonshell devices count --query '(labels == regex("unmanaged", "i"))'
3.2.6.2.3.1. Notes¶
Note
This example works the same for both the devices get-by-saved-query
and users get-by-saved-query
commands.