3.2.6. devices/users get-by-saved-query¶
This command will get assets returned from a saved query for users or devices.
3.2.6.1. Common Options¶
Connection Options for examples of supplying the Axonius credentials and URL.
Export Options for examples of exporting data in different formats and outputs.
Selecting Fields Examples for examples of selecting which fields (columns) to include in the response. The fields you supply for get-by-saved-query will be appended to the fields specified inside of the saved query. (added in 2.1.4)
3.2.6.2. Examples¶
3.2.6.3. Help Page¶
3.2.6.3.1. axonshell devices/users get-by-saved-query¶
Get assets using a saved query.
axonshell devices/users get-by-saved-query [OPTIONS]
Options
- -u, --url <URL>¶
Required URL of an Axonius instance
- -k, --key <KEY>¶
Required API Key of user in an Axonius instance
- -s, --secret <SECRET>¶
Required API Secret of user in an Axonius instance
- --max-rows <max_rows>¶
Stop fetching assets after this many rows have been received
- --max-pages <max_pages>¶
Stop fetching assets after this many pages have been received
- --page-size <page_size>¶
Number of assets to fetch per page
- Default
2000
- --page-sleep <page_sleep>¶
Seconds to wait in between each fetch of a page
- Default
0
- -xf, --export-file <PATH>¶
File to save data to (supports templating: {DATE}, {HISTORY_DATE})
- Default
- -xp, --export-path <export_path>¶
If –export-file supplied, the directory to write –export_file to (supports templating: {DATE}, {HISTORY_DATE})
- Default
/home/docs/checkouts/readthedocs.org/user_builds/axonius-api-client/checkouts/latest/docs
- -xo, --export-overwrite, -nxo, --no-export-overwrite¶
If –export-file supplied and it exists, overwrite it
- Default
False
- -xb, --export-backup, -nxb, --no-export-backup¶
If –export-file supplied and it exists, rename it with datetime
- Default
False
- --echo, --no-echo¶
Print out details during fetch
- Default
True
- --page-progress <page_progress>¶
Print progress every N rows
- Default
10000
- -xt, --export-format <export>¶
Formatter to use when exporting asset data
- Default
json
- Options
xlsx | xml | json | csv | json_to_csv | table
- -tf, --table-format <table_format>¶
Base format to use for –export-format=table
- Default
fancy_grid
- Options
asciidoc | double_grid | double_outline | fancy_grid | fancy_outline | github | grid | heavy_grid | heavy_outline | html | jira | latex | latex_booktabs | latex_longtable | latex_raw | mediawiki | mixed_grid | mixed_outline | moinmoin | orgtbl | outline | pipe | plain | presto | pretty | psql | rounded_grid | rounded_outline | rst | simple | simple_grid | simple_outline | textile | tsv | unsafehtml | youtrack
- --table-max-rows <table_max_rows>¶
Only return this many rows for –export-format=table
- Default
5
- --table-api-fields, --no-table-api-fields¶
Include API related fields in table output
- Default
False
- --schema, --no-schema¶
Add schema information to the export
- Default
False
- --json-flat, --no-json-flat¶
Flat JSON output (one line per row)
- Default
False
- --titles, --no-titles¶
Rename fields from internal field names to their column titles
- Default
False
- --field-compress, --no-field-compress¶
Compress field names
- Default
False
- --field-replace <field_replace>¶
Replace characters in field names ex: ‘text=replace’ (multiples)
- Default
- --join, --no-join¶
Join multivalue fields using –join-value
- Default
False
- --join-value <field_join_value>¶
Value to use for joining multivalue fields, default: n
- Default
- --join-trim <field_join_trim>¶
Character length to trim joined multivalue fields
- Default
32000
- -exf, --explode <FIELD>¶
Flatten and explode a fields values into multiple rows
- -exe, --explode_entities, --explode-entities, -nexe, --no-explode_entities, --no-explode-entities¶
Split rows into one row for each asset entity (will enable include-details)
- Default
False
- --flatten, --no-flatten¶
Remove complex fields and re-add their sub-field values to the row
- Default
False
- -fx, --field-exclude <FIELD>¶
Fields to exclude from each row (multiples)
- Default
- --field-null, --no-field-null¶
Add missing fields with –field-null-value
- Default
False
- --field-null-value <field_null_value>¶
Value to use for fields that are not returned
- --adapters-missing, --no-adapters-missing¶
Add a column showing adapters missing from each asset
- Default
False
- --include-dates, --no-include-dates¶
Include history date and current date as columns in each asset
- Default
False
- --software-whitelist-file <whitelist>¶
Read in a file of software names to add missing and delta sw columns
- --tag <TAG>¶
Tags to add to each asset (multiples)
- Default
- --untag <TAG>¶
Tags to remove from each asset (multiples)
- Default
- -id, --include-details, -nid, --no-include-details¶
Include details for aggregated fields
- Default
False
- -sd, --sort-descending, -nsd, --no-sort-descending¶
Sort –sort-field descending
- Default
False
- -sf, --sort-field <sort_field>¶
Sort assets based on a specific field
- -f, --field <ADAPTER:FIELD>¶
Fields to include in the format of adapter:field (multiples)
- -fr, --field-regex <ADAPTER_REGEX:FIELD_REGEX>¶
Regular expressions of fields to include (multiples)
- -frro, --fields-regex-root-only, -nfrro, --no-fields-regex-root-only¶
Only include root fields for –field-regex
- Default
True
- -ff, --field-fuzzy <ADAPTER:FIELD>¶
Fuzzy matching of fields to include (multiples)
- -fro, --fields-root <ADAPTER>¶
Select all root fields for a given adapter (PERFORMANCE HIT!)
- -fer, --fields-error, -nfer, --no-fields-error¶
Throw errors for invalid fields supplied in –field
- Default
True
- -hd, --history-date <YYYY-MM-DD>¶
Return results for a given date in history
- -hda, --history-days-ago <history_days_ago>¶
Return results for a history snapshot N days ago
- -hex, --history-exact, -nhex, --no-history-exact¶
Date supplied in history-date or history-days-ago is an exact date
- Default
False
- -n, --name <name>¶
Required Name of saved query
- --help-detailed <help_detailed>¶
Show detailed help and exit
- Options
auth | assetexport | selectfields