How to generate dashboard panels automatically?

Is there a way to more efficiently create a dashboard with panels in a more automatic way?

In my basic example, which I created manually, I display the CPU and Memory using queries like this:

  "timestamp" AS "time",
  value as cpu
FROM trend_view
  $__timeFilter("timestamp") AND
  serverid = '3a970e21-9a87-ea42-b7bf-f9322fab2827' AND
  logid = 96873

It’s only the logid that changes from server to server, so what I basically want to achieve is to provide a list of those id’s and then create multiple panels with the query above or one panel with many queries like the one above.

Is this possible to do in Grafana somehow?

@michaelperssonse are you talking about creating a dashboard like this?

If so, then I’d take a look at chained variables in the docs:

That is exactly it! Thanks for sharing! But I’m having issues with it:

The first query “allsources”:

SELECT source FROM trend_meta
WHERE source LIKE '%/LS-EC%Sys%/%Mem%'

It returns a list of all servers so that I can multiselect many servers.

Then the second query “externalid”:

SELECT externallogid FROM trend_meta
WHERE source = $allsources

But this second query only gets one value even if multiple servers are selected in query one.

Is there something obvious wrong with this?