- 20 Aug 2023
- 4 Minutes to read
- Updated on 20 Aug 2023
- 4 Minutes to read
Once you create a new query on one of the asset pages, or update an existing query, you can save it. Once saved, it is added to the Saved Queries list and can be selected anywhere a query is used, such as in Enforcement Sets, Dashboard Charts, Reports, Data Analytics, and more.
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 assets 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.Note:The “view” is saved as part of the saved query. It doesn’t impact the filtered asset data; only the data that is visible in the query results table.
To save a query: (All Data Scopes is enabled)
After you create 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 unique name for the query.
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.
Under Access, select specific roles you want to have access to the query. The query creator always has Editor access.
Then, select the permission to be granted to the selected roles:
Note:Individual roles cannot be configured to No Access.
- No Access - The selected roles will not have access to the query. This is useful if you want to grant access to all roles except a few.
Note:See Managing Roles for more information about assiging permissions to roles at the system level.
- System Access - The selected roles are granted access according to the permissions configured for each role.
- Viewers - The selected roles only have permission to view the query, regardless of the permissions configured for each role.
- Editors - The selected roles have permission to view and edit the query, regardless of the permissions configured for each role.
For All roles, select the permission level for all roles not specifically selected above.
A description of the access settings is displayed in the blue message area.
When in the Global Data Scope, you can select Share with selected roles within all Data Scopes if you want users with the selected roles that are assigned any Data Scope to have access to the query.
Select Admin Access Only to give access only to users with the Admin role.
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 folder of the current Data Scope.
- Queries accessible to all Data Scopes are saved in the Shared Queries folder.
- Private queries are saved in the My Private Queries folder.
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 select a saved query, 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.