Created: 2011-07-11 17:30
Updated: 2013-10-22 16:16



httpJsonStats is a script to parse key/value pairs out of Json output from a web url and format it for the Graphite input.

Example Lets say we have URL which outputs a json format stats for a application

# curl

similarly We can have other servers also which output in similar format

It accepts a json config to form proper urls , parse them , construct key value pairs and send it to Graphite server , Example Config is Below

  "global": { 
    "GRAPHITE_PORT"   : 2003,
    "INTERVAL"      : 20, 
        "LOG_FILE"       : "/tmp/httpJsonStats.log", 
        "ERR_LOG_FILE"   : "/tmp/httpJsonStats.log", 
        "PID_FILE"       : "/tmp/"
      "host": ",",
      "port": "9090",
      "groups": {
          "packet_stats": {
              "URN": "/context/stats.all"
          "Stream_Aggregated_Stats": {
              "URN": "/context/stats.streams.all"
          "Stream_Aggregated_Sessions": {
              "URN": "/context/stats.sessions.all"



Above config will Form URLs as below

and Sends stats to graphite according to key/value pairs output by above URLs.

The Graphite naming scheme it create is as follows


You can filter particular keys from a json response . "filter" can be a regular expression Example :

   "NonHeapMemoryUsageUsed": { 
        "URN": "/jolokia/read/java.lang:type=Memory/NonHeapMemoryUsage/used" , 
        "filter": "value"
    } , 

You can also override port config for a particular group . Example:

    "connectedEntities": {
      "URN": "/stats/connectedEntities.json", 
      "port" : "8080"
    } , 

You can view a screenshot for further clarification , SCREENSHOT Installation


Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more