Queries

• 5 min to read •

Syxsense Manage collects useful inventory data from each device on a routine basis. Queries allow you to filter devices by this data to show similarities or differences in values.

Queries are a dynamic and prescriptive management system that contain endpoints only as long as the endpoint meets the attribute filters prescribed by the query.

Queries are a many-to many relationships and an endpoint may exist in many concurrent queries depending on it’s status.

Important Information

A query consists of one or many Boolean logics.  A query can be useful to gather devices that you wish to target with a deployment task, such as software deployment;

Queries are dynamic; a device may appear in the results of a query one day, but a configuration change on the device could result in disappearing the following day;

You can create folders that enable you to store related queries in one folder to keep them organized;

There are 'Default Queries' to offer you examples of these dynamic collections.  It is not possible to edit or delete these queries, but they can be copied;

Any query that you create is known as a 'Custom Query'; these can be copied, edited, or deleted.

Prerequisites 

A device in the console

An account with any level of scope assigned

Discovery: Query OptionsDiscovery: Query Options

Previews query results (does not automatically save the query)
Export the query logic
Save changes
Cancels changes since the last time the query was saved
  Name of a query.
  A useful description of the query.
  Allows you to restrict the query so that it only runs against a Site of devices.
  Used to add one more calculation into the query.
  Used to remove a specific calculation from the query.  Calculations that are part of a group will need to be ungrouped first.
  This is used in conjunction with the grouping feature.  If you place the tick of your calculation, you can join them together by using the button.
 

This is used to join previously selected lines of your calculation.  

At least two lines must be selected before this 'Join' feature will be activated.

 

When creating your calculation, you may use the 'And/Or' feature to enable flexibility where required.

Example 1: The Device Type is Workstation OR Laptop.

Example 2: The Device Type is Workstation AND the Manufacturer is DELL.

  The inventory data field. 
 

The operator allows specific or multiple selective calculations to be created.

Example 1:  OS Name = Microsoft Windows 7 Professional.

Example 2:  OS Name 'LIKE' %Server%.

 

By default, you may display values from the database by pressing the down arrow or if you know the value you want to search for you may enter it manually.

 If the value is in the form of date/time, then additional functionality may be available. This functionality will be in the form of variables such as $TODAY or $LASTWEEK. 

As an example of using a variable $TODAY-10 could be used, a simple calculation would be performed which would use subtract 10 days from the current date. The Operators used when using a calculation would generally be 'greater than' or 'less than'.

  Export the query results as a CSV file (prompts download). 
  Configure the column sets that have been created within the Syxsense Manage console. 
  Select the column set that the query will use when displaying the results.

Guided walk-through: How to Create a New QueryGuided walk-through: How to Create a New Query

To access the Device Queries area of the console click on Devices ① 

Expand 'Queries' or 'Default Queries' folder ②Drop-down TitleDrop-down Title

To create a new folder or query either right-click on Queries or use the options at the top of the screen ③ ④Drop-down TitleDrop-down Title

An example of creating a new query:

In the example shown, all the Windows 10 devices that require a reboot will be found by using a device query:

The query has been given the name ⑤.

'OS' ⑥ has been typed into the Field text area, the console will automatically list all the inventory data fields that contain 'OS'.

Alternatively, the down arrow ⑦ can be used to show all the inventory data fields which will allow you to drill down to locate the field that you are interested in.

OS Name has been selected ⑧Drop-down TitleDrop-down Title

Click the Operator down arrow ⑨ to select the appropriate operator.

In this example, the 'like' operator has been selected. Drop-down TitleDrop-down Title

Click on the Value down arrow ⑩ to select 'Microsoft Windows 10'

Note that you can edit an existing value or manually type the value into the text field.

If we were to Save this line of Boolean logic and run the query, it would return all the devices in the console that are running any version of Microsoft Windows 10.

 At least one device must have reported back a given operating system for it to be available as a selectable choice. The same caveat applies to all the data displayed in the 'Value' drop-down list. Drop-down TitleDrop-down Title

In this example, the second line of Boolean logic has been added to the query by using the plus symbol ⑪, the second line will filter the data to find devices where the 'Is Reboot Required' data has a value of 'True'.

Note that the 'And/Or' logic can have a dramatic effect on the results that are returned when the query is run. In this example 'And' has been selected. 

Click 'Save' ⑫ to save the query or click 'Run Query' ⑬ if you just wish to run the query.

The Export option allow to export the query logic ⑭.Drop-down TitleDrop-down Title

In this example the query has been saved and run, it is returned information on two devices, they are both running Windows 10 and require a reboot.  Drop-down TitleDrop-down Title

Video Tutorials: Device Query ExamplesVideo Tutorials: Device Query Examples

Watch an example of a Device Query creation  Video

Creating a Dynamic group for devices that have not been patched in 14 days  Video

Creating a query based on created Groups  Video

Last Update: Mar 12, 2024

Copyright ©2024 by Syxsense, Inc. All Rights Reserved