Running the same query against multiple databases with the same schema
I have a database per client and would like to run the same query against all clients (thousands of them), pool the results together and drive dashboards from them.
The agent supports a way to query multiple databases using a wildcard token.
In the agent distribution, under examples folder, see datasource_example_mysql.json and query_example_mysql.json for an example.
/* Wildcard token to connect to multiple databases with the same schema */
In this example, we will pick up any database that contains app_XXX_somepostfix in the database name.
/* Executes against multiple databases and combines the result */
"queryStr":"select * from sometable",
/* Optional c9QL that runs on the combined query results.*/
"c9QLFilter":"select count(*) as Total count, \"MySQL Counts\" as MySQL",
The results can be queried, visualized and analyzed as needed.
Note: This is currently supported on SQL databases and MongoDB datasources only. Contact us if you need support for another database.Comment actions
Please sign in to leave a comment.