From collectd Wiki
Jump to: navigation, search

The JavaScript Object Notation (JSON) is a data interchange format with a simple and straight forward grammar.

A sample value_list_t converted to JSON would look like this:

     "values":  [1901474177],
     "dstypes":  ["counter"],
     "dsnames":    ["value"],
     "time":      1280959128,
     "interval":          10,
     "host":            "leeloo.octo.it",
     "plugin":          "cpu",
     "plugin_instance": "0",
     "type":            "cpu",
     "type_instance":   "idle"

You can use the header src/utils_format_json.h for an interface to conversion functions.

See also