How To Query Custom Fields


This article discusses how to query on the CloudBolt MySQL database instance and get a list of all servers and their corresponding expiration dates.


We're going to issue a SQL query that joins the infrastructure_server table to its corresponding custom field tables:

	s.hostname,, ocfv.*
	infrastructure_server s, 
	`infrastructure_server_custom_field_values` cfv, 
	`orders_customfieldvalue` ocfv,
	`infrastructure_customfield` cf
where = cfv.server_id 
	and cfv.`customfieldvalue_id` = ocfv.`id` 
	and ocfv.`field_id` = cf.`id`
	and = 'expiration_date'
	and s.status = 'ACTIVE'

This query will return a result set similar to:

winhost004	expiration_date	2015-08-11 00:00:00
mchost-003	expiration_date	2015-08-29 00:00:00
mchost-004	expiration_date	2015-08-29 00:00:00
mchost-005	expiration_date	2015-09-04 00:00:00
mchost-006	expiration_date	2015-09-04 00:00:00
PCI-LIN-006	expiration_date	2015-10-15 00:00:00
PCI-LIN-008	expiration_date	2015-10-16 00:00:00
PCI-LIN-001	expiration_date	2015-11-10 00:00:00
FINCLOUD0005	expiration_date	2015-11-10 00:00:00
svcFinance001	expiration_date	2015-11-12 00:00:00

Additional information!cloudbolt-latest-docs/resources-for-writing-plug-ins/q/alladmin/qid/4628/qp/1

Have more questions? Submit a request


Please sign in to leave a comment.