The following query will list the number of hosts associated with all serverclasses on your Splunk Deployment server. This query should be run on your Deployment Server.
| rest /services/deployment/server/clients splunk_server=local | table hostname applications.*.serverclasses | untable hostname applications | rex field=applications "applications\.(?<apps>.+)\.serverclasses" | stats dc(hostname) as hostname by apps
If this query does not work for you try:.+)\.serverclasses” | stats dc(hostname) as hostname b
| rest /services/deployment/server/clients splunk_server=local | table hostname applications.*.serverclasses | untable hostname, applications, serverclass | rex field=applications “applications\.(?
Thanks @Lyx for posting a fix!