Cloady Docs
API ReferenceEndpointsApplications

Search a service's log by category

Reads the service's log the way its software writes it and sorts the lines into categories: for the service the app's address routes to, the ingress access log by status class beside the service's own errors; for PostgreSQL, slow statements, lock waits, deadlocks, errors, connections, autovacuum, checkpoints and temporary files; likewise for MySQL, MongoDB, ClickHouse, Redis, RabbitMQ, Postfix, Sidekiq and Celery; other services by level. Returns each category's line count and volume per step, and the newest 200 lines of the requested categories with the fields parsed from them and, for PostgreSQL, the statement logged with them. Filters take the fields `level` and, on access logs, `route`. Logs are kept for seven days. `serviceName` is a compose service.

GET
/api/workspaces/{workspaceSlug}/apps/{appSlug}/services/{serviceName}/logs/role
AuthorizationBearer <token>

Personal API token (cldy_…)

In: header

Path Parameters

workspaceSlug*string
appSlug*string
serviceName*string

Query Parameters

env?string

Value in

  • "production"
  • "preview"
  • "development"
region?string
range?string

How far back to look; the answer has 30 to 96 points across it

Default"1h"

Value in

  • "15m"
  • "1h"
  • "6h"
  • "24h"
  • "7d"
q?string

Text a line, or the statement logged with it, must contain, ignoring case

Lengthlength <= 200
category?string

Comma-separated categories whose lines to return; the default categories when absent, none when empty

Lengthlength <= 400
filter?array<>

Filters, each written <field><op><value> with op =, !=, =~ or !~; =~ and !~ take a regular expression matched against the whole value, ignoring case. Repeat the parameter for several; every one must hold

Itemsitems <= 20

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/workspaces/string/apps/string/services/string/logs/role"
{  "preset": "access",  "start": 0,  "step": 0,  "categories": [    {      "id": "string",      "label": "string",      "on": true,      "source": "log",      "count": 0,      "volume": [        0      ]    }  ],  "lines": [    {      "ts": 0,      "category": "string",      "severity": "string",      "level": "error",      "message": "string",      "statement": "string",      "fields": {        "property1": "string",        "property2": "string"      },      "pod": "string"    }  ],  "routes": [    "string"  ],  "query": "string"}