Skip to content

We recommend to obtain the query json structure from the EPOCH AOC query builder. screen shot 2017-03-20 at 9 46 03 pm

Run Query

Request

  • Requires authentication
  • HTTP Method: POST
  • URL: http://your.epoch.url/api/v0/query

Response

Returns a JSON object containing array of datapoint values for each query statement.

Example

To run query for "HTTP Average Latency Group by HTTP URI for last 30mins" obtain the query json structure from AOC query builder. Store the json in say simple_query.json.

curl  -s -b headers -H "Content-Type: application/json" -X POST --data  @simple_query.json http://your.epoch.url/api/v0/query 

Note headers file has the authentication cookie.

Response:

  {
    "A": {          /* query statement name */
        "data": [   /* array of values */
            {
                "A": 283.0,
                "INTERVAL": 1490071814000.0,
                "http.uri": "/pks/lookup"
            },
            {
                "A": 284.0,
                "INTERVAL": 1490071864000.0,
                "http.uri": "/pks/lookup"
            },
            {...},
            {...},
            {
                "A": 52.0,
                "INTERVAL": 1490070640000.0,
                "http.uri": "/v2/apps/frontend/restart"
            }
        ],
    }
}