- 27 Feb 2023
- 3 Minutes to read
- Updated on 27 Feb 2023
- 3 Minutes to read
Once you create a new query on one of the asset pages (Devices, Users, or Vulnerabilities), or update an existing query, you can save it. Once saved, it is added to the Saved Queries list for future and advanced use. Saved queries are also used in Enforcement Sets, Dashboard Charts and Reports.
Saving a New Query
The Asset pages display the query name above the search bar along with the query status. The query status indicates whether this is a new query that is unsaved, or a saved query that has been edited.
When you save a query, the following information is saved:
- Query filter – The collected devices together with their details according to the filter set.
- Query view – The columns that are displayed when you save the query are saved as part of the query and used to display the same “view” of selected fields in the table every time you use this query. Set the columns in Edit Columns.NOTEThe “view” is saved as part of the saved query. It doesn’t impact the filtered devices data; only the data that is visible in the query results table.
To save a new unsaved query
After having created a query with the Query Wizard, above the left-upper corner of the asset list, click Save As.
The Save as a New Query dialog opens.
- In Query name, enter a Query name.
- In Query description, enter a description (optional).
- In Tags, choose a tag from the drop down list of tags available in the system or start typing to add a new tag. You can add as many tags as you need. When you add a new tag, click Add New to add the tag to the system. Use Clear All to remove a tag you selected. Tags help organize your queries. You can add a tag to a query when you create the query, as well as from the Saved Queries page. The list of tags used in queries is the same across the whole system. Tags are optional.
- To create an Asset Scope query, toggle Asset scope query on. The query will be saved in the Asset Scope Queries folder and it can be used to create Data Scopes. If this option is on, the Access section is not displayed.
In Folder name, select the folder where you want to save the query. The folders available depend on whether the query is private or public. By default, public queries are saved in the Shared Queries folder and private queries are saved in the My Private Queries folder.
When using Data Scopes, and Current Data Scope is selected, a folder with the name of the Data Scope is displayed and the query can be saved in any folder under that Data Scope folder. The query will be available to that Data Scope only.
If you have written a query in AQL using terms or expressions not supported in the Query Wizard, when you save the query the system informs you that the system will save the query as an AQL expression.
Running a Saved Query
Once a query is saved you can run it from the Queries page, from the Saved Query drawer or from the Saved Queries list in the Query Search Bar.
Saved Queries List in the Query Search Bar
In an Asset page, click the Query search bar. The drop-down list displays a list of saved queries and history of the queries run in Axonius.
To run a saved query, use the vertical scroll to select the saved query you want. Then click it to run the query.
Updating an Existing Saved Query
After you open a saved query on an Assets page, you can do the following:
- Rename a saved query with a single click.
- Save - Update the saved query you are working on.
- Save as - Save the query results as a new saved query.
- Discard Changes - Undo any changes made on the saved query you are working on and reload the saved query.
- Reset - Reset the page to its default column view and with no filtering, resulted in all devices/users being displayed.
- Copy Query Link - Click the copy Query Link icon from the Saved As drop down to copy the link to the query and then share it with others.