Appearance
Analytics and dashboards API Since v0.2
Every route here needs only viewer. Saved filters and dashboards belong to the caller. A caller with the operator role and access to every application may also share them. A caller with the viewer role cannot use fields that hold request values in filters or group-by, and gets masked group keys. For the settings, see Analytics, analyst and helper processes.
For the base URL, sign-in, roles and error format, see Management API. Except sign-in, a route answers 401 without credentials and 403 when the role is too low.
Routes
Queries
| Method | Path | Minimum role | What it does | Main fields |
|---|---|---|---|---|
GET | /v1/analytics/fields | viewer | Lists the fields each source offers to queries. | none |
POST | /v1/analytics/query | viewer | Runs one query: top values, a time series, a histogram or a count. | Body: source, kind (top, series, histogram, count), q, from, to, app, node. Response: the result for kind. |
POST | /v1/analytics/batch | viewer | Runs several queries in one call. | Body: queries (a list of query bodies). |
POST | /v1/analytics/validate | viewer | Checks query text and reports problems with positions. | Body: source, q. |
POST | /v1/analytics/to-rule | operator | Turns a query into a custom rule draft. Nothing is applied. Needs operator. | Body: source, q, name. |
Saved filters
| Method | Path | Minimum role | What it does | Main fields |
|---|---|---|---|---|
GET | /v1/filters | viewer | Lists saved filters. | none |
POST | /v1/filters | viewer | Saves a filter. | Body: filter name, source and query. |
GET | /v1/filters/{id} | viewer | Returns one saved filter. | none |
PUT | /v1/filters/{id} | viewer | Changes a saved filter. | Body: as create. |
DELETE | /v1/filters/{id} | viewer | Deletes a saved filter. | none |
Dashboards
| Method | Path | Minimum role | What it does | Main fields |
|---|---|---|---|---|
GET | /v1/dashboards | viewer | Lists dashboards. | none |
POST | /v1/dashboards | viewer | Creates a dashboard. | Body: dashboard name and widgets. |
GET | /v1/dashboards/templates | viewer | Lists dashboard templates. | none |
POST | /v1/dashboards/import | viewer | Imports a dashboard from an exported document. | Body: the exported dashboard. |
GET | /v1/dashboards/{id} | viewer | Returns one dashboard. | none |
PUT | /v1/dashboards/{id} | viewer | Changes a dashboard. | Body: as create. |
DELETE | /v1/dashboards/{id} | viewer | Deletes a dashboard. | none |
POST | /v1/dashboards/{id}/duplicate | viewer | Copies a dashboard. | Body: name (optional). |
Example
sh
curl -sk -X POST -H "Authorization: Bearer waap_EXAMPLE" -H "Content-Type: application/json" -d '{"source":"events","kind":"top","q":"action = block","from":"-24h"}' https://127.0.0.1:9443/v1/analytics/query