Explore your inventory
Use rportcli client list to browse your inventory. With the --search flag you can narrow down the search.
--search takes a key value pair, and it can be used multiple times. For example:
rportcli client list --search os_kernel=linux --search name="a*"
The above search fetches all clients where the key os_kernel matches exactly the term linux and where the key
name starts with a.
Each --search accepts multiple keys separated by a comma. For example:
rportcli client list --search tags=Germany,France
The criteria are combined with OR. The above search fetches all clients having a tag “Germany” or “France”.
- When using
--searchmultiple times, the search criteria are combined with a logicalAND. A combination withORis not yet supported.- All searches are case-insensitive.
rportcli client list --search name=elmo,julia --search os_kernel=Linux
Translated to pseudo-sql the above would resolve to:
WHERE (name="elmo" OR name="julia") AND os_kernel="Linux"
You can search on multiple keys concurrently. For example:
rportcli client list --search "name|ipv4=192.168.122.*,elmo"
Translated to pseudo-sql the above would resolve to:
WHERE name="elmo" OR ipv4 LIKE "192.168.122.%" OR ipv4="elmo" OR name LIKE "192.168.122.%"
The following search keys are supported:
idnameosos_archos_familyos_kernelos_full_nameos_versionos_virtualization_systemos_virtualization_rolecpu_familycpu_modelcpu_model_namecpu_vendornum_cpustimezonehostnameipv4ipv6tagsversionaddressclient_auth_idconnection_stateallowed_user_groupsgroups
Using --search "*=*win* is also supported giving you some kind of full-text search over all fields.
By default, a maximum of 50 rows are displayed. Use --limit to display more. Or use --offset to move to
the next page. Examples:
# Get the first 10 results
go run ./... client list --search name=a* --limit 10
# Get the second 10 results
go run ./... client list --search name=a* --limit 10 --offset 10
By using the flag -o, --output <FORMAT> you can change the output format to json, yaml or human (default).
Using the json output combined with jq you can create flexible reports. For example:
$ rportcli client list --search os_kernel=windows -o json|jq '.[]|[.name,.connection_state]|@tsv' -r
ITXC connected
JONATHAN-LITTLE connected
Brooke-Hicks connected
Testing-Win-SRV-2012R2 connected
DONALD-DAY-WS20 connected
ERIC-GARCIA-WS2 disconnected
ABRAHAM disconnected
Homer disconnected
BOB-MORGAN-WS20 disconnected
Alan-Fernandez-WS2019 disconnected
Win11-Bonn connected
ELLIE-DOUGLAS-W connected
BEATRICE connected
Grandmother-W2012R2 disconnected