How to filter CMDB_CI by Tag, Key, Value

J Moxy
Tera Contributor

Using DIscovery on Azure Servers, the Virtual Machine Instances are configured with various Keys and Tags .  These are discovered and brought into the CMDB by Discovery.  I now want to filter the CMDB_ci.list table based on a Key value.  Can someone help with how this can be done.  See image of a typical CI with Tag Key info I want to use in Filter . e.g. Environment = Dev

1 ACCEPTED SOLUTION

Afrith Shariff
Tera Guru

Hi @J Moxy ,

 

Can you please check this link - https://www.servicenow.com/community/cmdb-forum/how-to-create-cmdb-reports-with-tags/td-p/2876728

 

Query Builder provides enhanced capabilities:

  1. Navigate to CMDB Workspace and use Intelligent Search
  2. Access Query Builder from the search results
  3. Drag the desired CI class to the canvas
  4. Add filter conditions using the related cmdb_key_value table
  5. Configure key-value pair filters as needed

Thanks,

Afrith

View solution in original post

3 REPLIES 3

kaushal_snow
Mega Sage

Hi @J Moxy ,

 

In your scripts or queries you must join or query cmdb_key_value where key = Environment and value = Dev pointing back to the CI, or use CMDB Query Builder to add a related list filter on Key Value with those conditions, or create a database view combining cmdb_ci and cmdb_key_value so you can build list views or reports showing only the CIs that have that tag.....

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/

Afrith Shariff
Tera Guru

Hi @J Moxy ,

 

Can you please check this link - https://www.servicenow.com/community/cmdb-forum/how-to-create-cmdb-reports-with-tags/td-p/2876728

 

Query Builder provides enhanced capabilities:

  1. Navigate to CMDB Workspace and use Intelligent Search
  2. Access Query Builder from the search results
  3. Drag the desired CI class to the canvas
  4. Add filter conditions using the related cmdb_key_value table
  5. Configure key-value pair filters as needed

Thanks,

Afrith

Thanks for the reference to Query builder I was able to create a query that returns the records from the VM Instance table with the Keys i am looking for.

This query now returns a list of VMI names.  I would like to include the server types. How can I add the Server class from the Server table to this query (see attached).  

 

Thanks all for your help to get me closer...

J