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: