Skip to content

Invalid JSON structure - trailing comma

Hi folks,

I noticed that some of the occtl commands return invalid JSON structure. Here are some of them:

  • show session all/valid
  • show status
{
    "Status":  "online",
    "Server PID":  3772,
    "Sec-mod PID":  3773
    "Up since":  "2019-08-27 00:04",
    "_Up since":  "   35s",
    "Active sessions":  0,
    "Total sessions":  0,
    "Total authentication failures":  0,
    "IPs in ban list":  0,
    "Last stats reset":  "2019-08-27 00:04",
    "_Last stats reset":  "   35s",
    "Sessions handled":  0,
    "Timed out sessions":  0,
    "Timed out (idle) sessions":  0,
    "Closed due to error sessions":  0,
    "Authentication failures":  0,
    "Average auth time":  "    0s",
    "Max auth time":  "    0s",
    "Average session time":  "    0s",
    "Max session time":  "    0s",
    "RX":  "0 bytes",
    "TX":  "0 bytes",
  }

These commands returns a JSON structure with trailing comma and this caused a JSON processor not able to process it.

Edited by Edwin Nathaniel