Analyzing MaxCtrl Report Output
The output of the maxctrl create report
command produces a JSON payload that contains the current state of MaxScale. This includes the runtime configuration and the status all objects in MaxScale.
Creating a MaxCtrl Report
The report can be created with:
maxctrl create report maxctrl-report.json
After the command completes, the data is in maxctrl-report.json
.
The file in which the output is stored is the only argument to this command. Recent versions of maxctrl pipe the output to the standard output if no filename is given. This can be useful for environments where copying files may be difficult (e.g. docker).
Using jq
The easiest way to inspect the JSON output is to use the jq program: https://jqlang.github.io/jq/
It is usually available as a package in most operating systems.
List keys of objects
jq 'keys' < maxctrl-report.json
Get a specific service
Change the RW-Split-Router
to the name of the service you're looking for.
jq '.services.data|map(select(.id == "RW-Split-Router"))' < maxctrl-report.json
Get a specific monitors
Change the MariaDB-Monitor
to the name of the monitor you're looking for.
jq '.monitors.data|map(select(.id == "MariaDB-Monitor"))' < maxctrl-report.json