Skip to content

Event Histogram

Santanu edited this page May 31, 2014 · 5 revisions

The histogram operation gives event histogram over a given date range. Default histograms are on the _timestamp field.

Note Periods where there are zero events do not appear in the results

##Request

{
    "opcode": "histogram",              //This is histogram operation (not-null)
    "table": "test-app",                //Your app/table name (not-null)
    "filters": [                        //Array of filters (default: no filters)
        {
            "field": "battery",
            "operator": "greater_than",
            "value": 48
        }
    ],
    "from": 0,                          //Start time (default: current time - 24h)
    "to": 1398836962800,                //To time (default: current time)
    "field": "_timestamp",              //Date field on which this will get calculated (default: timestamp)
    "period": "days"                    //Period by which events are bucketed ["days", "hours", "mins"] (default: "mins")
}

##Response { "opcode": "histogram", "counts": [ { "period": 1397606400000, "count": 4 }, { "period": 1397952000000, "count": 1 }, { "period": 1398643200000, "count": 1 } ] }