Tag Queries are SQL
Queries to select target hosts or Client IP Addresses from different tables
according to requirements. Tag Queries is executed on Database, and the result
set is used as target devices. Tag Queries are used in Inventory Rules and
Classification Rules. You can define your queries based on Any Host information,
IP Ranges/Blocks, Network Device Information or any Inventory Data, which is
collected from client devices.There are 59 predefined
Tag Query definitions available by default. You can add as many as tag queries.
To define Tag Queries navigate to SettingsàSystem Parameters and select Tag Queries menu. On the right-hand side in the upper cornet click “Add Query” button.
Field Name |
Definition |
Name |
Name of your Tag Query. This name will be shown in Inventory and
Classification Rules. |
|
|
Type |
Type Of Your Query. Defines which table(s) could be used for querying
host information. |
Query Table |
Name of the table (s) according to your Type selection. You can only
select one table per query. |
Query Table Column |
Name of the Column in the selected table will be checked. |
Query Value |
The value will be checked against the selected Table Column. |
Condition |
How Query value will be evaluated in the SQL Query. |
Figure 2 Defining Tag Query
By using the above mappings, an SQL Query is created at the background:
SELECT IP_ADDRESS from NAC_DETECTED_HOSTS WHERE MACVENDOR=’Cisco’
You can edit condition string by using other SQL keywords; LIKE, AND, OR, <> e.t.c
After finishing your settings, you can save your tag query
to later use in Inventory or Classification rules.
Because Tag Queries plays a crucial role in Inventory and Classification rules, you can check weather your Tag Queries Evaluated correctly or not. To view your Tag Query result navigate to All Hosts on the main menu and click the arrow icon next to the main menu items.
Once you click the arrow icon, hidden Toggle menu comes out the screen.
Under the Tag Queries Section, you can find all defined Tag Queries. Tag Queries again grouped into Types here. In a production environment, you may have so many Tag Queries and testing or finding one by one may be difficult. To eliminate this difficulty on the top of the Toggle menu, there is a search box to find your queries. Once you find your Tag Query, just click on it to view results on the Hosts List table.
Figure 5 Searching and Viewing Tag
Query Results