Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-6755

maxctrl2: `show server <name> --tsv` outputs pretty-printed JSON

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Cannot Reproduce
    • None
    • N/A
    • N/A
    • None
    • MXS-SPRINT-277

    Description

      This is what maxctrl2 outputs:

      [vagrant@localhost maxctrl-diffs]$ maxctrl2 --tsv show server server1|head -n 30
      2026-07-22 12:24:04   notice : URL: curl -X GET -u admin:mariadb http://127.0.0.1:8989/v1/servers/server1
      Server	server1
      Source	/usr/local/data/maxscale.cnf.d/server1.cnf
      Address	127.0.0.1
      Port	3000
      State	Down
      Status	{
          "extra": "",
          "mode": "Normal",
          "reason": [],
          "state": "Down"
      }
      Version	
      Uptime	0
      Last Event	server_down
      Triggered At	Wed, 22 Jul 2026 10:41:55 GMT
      Services	RW-Split-Router, Read-Connection-Router, SchemaRouter-Router
      Monitors	MariaDB-Monitor
      Master ID	-1
      Node ID	-1
      Slave Server IDs	
      Current Connections	0
      Total Connections	0
      Max Connections	0
      Statistics	{
          "active_operations": 0,
          "adaptive_avg_select_time": "0ns",
          "connection_pool_empty": 0,
          "connections": 0,
          "failed_auths": 0,
          "max_connections": 0,
      

      The TSV mode should strip newlines from each field (probably also tabs) so that the values don't break the TSV format.

      The line counts should be identical.

      [vagrant@localhost maxctrl-diffs]$ maxctrl --tsv show server server1|wc -l
      20
      [vagrant@localhost maxctrl-diffs]$ maxctrl2 --tsv show server server1|wc -l
      2026-07-22 12:23:01   notice : URL: curl -X GET -u admin:mariadb http://127.0.0.1:8989/v1/servers/server1
      202
      

      Attachments

        Activity

          People

            johan.wikman Johan Wikman
            markus makela markus makela
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 0.2h Time Not Required
                0.2h

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.