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

URL of an Axonius instance [required]

-k, --key <key>

API Key of user in an Axonius instance [required]

-s, --secret <secret>

API Secret of user in an Axonius instance [required]

--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 <export_file>

File to send data to [default: ]

-xp, --export-path <export_path>

If –export-file supplied, the directory to write –export_file to [default: /home/docs/checkouts/readthedocs.org/user_builds/axonius-api-client/checkouts/develop/docs]

-xo, --export-overwrite, -nxo, --no-export-overwrite

If –export-file supplied and it exists, overwrite it [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:csv|json|table|json_to_csv
--table-format <table_format>

Table format to use for –export-format=table [default: fancy_grid]

Options:fancy_grid|github|grid|html|jira|latex|latex_booktabs|latex_raw|mediawiki|moinmoin|orgtbl|pipe|plain|presto|pretty|psql|rst|simple|textile|tsv|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

--join, --no-join

Join multivalue fields using –join-value

--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]

--explode <field_explode>

Flatten and explode a fields values into multiple rows [default: ]

--flatten, --no-flatten

Remove complex fields and re-add their sub-field values to the row

-fx, --field-exclude <field_excludes>

Fields to exclude from each row (multiples) [default: ]

--field-null, --no-field-null

Add missing fields with –field-null-value

--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]

--tag <tags_add>

Tags to add to each asset (multiples) [default: ]

--untag <tags_remove>

Tags to remove from each asset (multiples) [default: ]

-id, --include-details, -nid, --no-include-details

Include details for aggregated fields (req: 3.4 + patch) [default: False]

-sd, --sort-descending, -nsd, --no-sort-descending

Sort –sort-field descending (req: 3.4 + patch) [default: False]

-sf, --sort-field <sort_field>

Sort assets based on a specific field (req: 3.4 + patch)

-hd, --history-date <history_date>

Return results for a given date in history

-f, --field <fields>

Fields to include in the format of adapter:field (multiples)

-fr, --field-regex <fields_regex>

Regular expressions of fields to include (multiples)

-n, --name <name>

Name of saved query [required]

--help-detailed <help_detailed>

Show detailed help and exit

Options:auth|assetexport|selectfields