Analyzing MaxCtrl Create Report Output

Learn to inspect MaxScale's runtime state using the JSON report from maxctrl. Use jq to query servers services and monitors for detailed debugging and analysis.

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.

The maxctrl create report command was added in MaxScale 2.5.20.

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:

It is usually available as a package in most operating systems.

List servers

jq '.servers.data[].id' < maxctrl-report.json

List services

jq '.services.data[].id' <  maxctrl-report.json

List monitors

List listeners

List filters

List keys of objects

This can be combined with the object field access to list the fields of sub-objects. The following lists the keys in the first server object.

Get a specific service

Change the RW-Split-Router to the name of the service you're looking for.

Get a specific monitor

Change the MariaDB-Monitor to the name of the monitor you're looking for.

Get a specific server

Change the DB-1 to the name of the server you're looking for.

Find the monitor for a server

Change DB-1 to the name of the server you're looking for.

Memory used by the query classifier cache

This page is licensed: CC BY-SA / Gnu FDL

Last updated

Was this helpful?