Sazabi
APILogs

Run a log query

Run a log query with no model involved, given either the queryId of an earlier logs.ask answer or logs.executeQuery run, or a spec written in the log query spec (its JSON Schema is this operation's spec input; sazabi logs query schema prints it). Runs over window (by default the same absolute times a queryId read, or the last hour for a spec; a relative window ends now, which asks the same question again over the latest period), with an optional limit, or narrowed to the log lines of one group of a table. Returns the same envelope as logs.ask without an answer: results, what was measured (explanation), the part of the window the numbers cover (meta), and a new queryId naming this run (its query and the times it read). A run by queryId names that id as parentId. rows results page: when more lines matched than limit holds the envelope carries a nextCursor, and passing it as cursor with the same query reads the next limit lines over the same times; a table, series, value or kinds result returns at most limit groups and never pages. An unknown queryId is not found; a spec the service cannot run is refused with what to change; asking the question again yields a new id.

POST https://api.sazabi.com/v1/logs/queries/execute

POST
/logs/queries/execute

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/logs/queries/execute" \  -H "Content-Type: application/json" \  -d '{}'
{  "queryId": "10210520-b895-40ca-bce5-474f9643bf53",  "parentId": "70850378-7d3c-4f45-91b7-942d4dfbbd43",  "status": "ok",  "answer": "string",  "explanation": "string",  "interpretedAs": "string",  "results": {    "kind": "search",    "kinds": [      {        "message": "string",        "severity": "string",        "services": [          {            "service": "string",            "count": 0          }        ],        "count": 0,        "previousCount": 0,        "firstSeen": "string",        "firstSeenInWindow": true,        "lastSeen": "string",        "examples": [          {            "id": "string",            "time": "string",            "service": "string",            "severity": "string",            "body": "string",            "attributes": {              "property1": "string",              "property2": "string"            },            "traceId": "string",            "spanId": "string"          }        ]      }    ],    "matched": 0,    "truncated": true,    "previousWindow": {      "from": "2019-08-24T14:15:22Z",      "to": "2019-08-24T14:15:22Z"    }  },  "window": {    "from": "2019-08-24T14:15:22Z",    "to": "2019-08-24T14:15:22Z"  },  "periods": [    {      "name": "string",      "window": {        "from": "2019-08-24T14:15:22Z",        "to": "2019-08-24T14:15:22Z"      },      "results": {        "kind": "search",        "kinds": [          {            "message": "string",            "severity": "string",            "services": [              {                "service": "string",                "count": 0              }            ],            "count": 0,            "previousCount": 0,            "firstSeen": "string",            "firstSeenInWindow": true,            "lastSeen": "string",            "examples": [              {                "id": "string",                "time": "string",                "service": "string",                "severity": "string",                "body": "string",                "attributes": {                  "property1": "string",                  "property2": "string"                },                "traceId": "string",                "spanId": "string"              }            ]          }        ],        "matched": 0,        "truncated": true,        "previousWindow": {          "from": "2019-08-24T14:15:22Z",          "to": "2019-08-24T14:15:22Z"        }      }    }  ],  "meta": {    "coverage": {      "from": "2019-08-24T14:15:22Z",      "to": "2019-08-24T14:15:22Z",      "status": "complete",      "reason": "stored_range"    }  },  "rejection": {    "code": "bucket_too_fine",    "message": "string"  },  "writeDeclined": true,  "attempts": [    {      "n": 0,      "action": "string"    }  ],  "timings": {    "planMs": 0,    "executeMs": 0,    "answerMs": 0,    "totalMs": 0  },  "nextCursor": "string"}