Cluster logger

Create and manage cluster loggers.

See also logging for more information on common providers and templates.

Part of the API reference collection

This page is part of the Crunchy Bridge API reference, and primarily meant to act as an exhaustive guide for technical integrations which are already in progress. To understand the basics of using the API, see API concepts and getting started.

The ClusterLogger API resource

Response of a singleton cluster logger request.

Content type: application/json

NameNullableTypeDescription
idstring in EID format

Unique ID of the logger.

cluster_idstring in EID format

The ID of cluster that the logger belongs to.

descriptionstring

Human-readable description of the logger. For purposes of convenience and bookkeeping only.

hoststring

Target host of the logger. See documentation for logging to get standard hostname configuration for common logging providers.

host_and_portstring

The combined host and port separated by a colon (:).

portinteger

Target port of the logger. See documentation for logging to get standard port configuration for common logging providers.

team_idstring in EID format

The ID of the team that owns the associated cluster.

templatestring

Template to use for the logger. See documentation for logging to get templates for common logging providers.

Example

{
    "cluster_id": "rvf73a77ozfsvcttryebfrnlem",
    "description": "LogDNA log destination.",
    "host": "syslog-a.logdna.com",
    "host_and_port": "syslog-a.logdna.com:6514",
    "id": "s3q3zqzdr5fqbgya7xupxxpyva",
    "port": 6514,
    "team_id": "eaevtjiudzeq7bsqbbpiscund4",
    "template": "<${PRI}>1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} ${MSGID} [logdna@48950 key=\\\"MY-INGESTION-KEY\\\"] $MSG\\n"
}

List loggers

List existing loggers for a cluster.

This endpoint's pagination may be ordered through the order_field parameter by id or host_and_port. Defaults to being ordered by id.

GET /clusters/{cluster_id}/loggers

Request

Path parameters

  • cluster_id: Unique ID of the cluster.

Query parameters

NameRequiredTypeDescription
cursorstring

Return only items starting after this cursor ID. When paginating, pass the value of next_cursor from the last page into this field to get the next one.

Cursor values depend on the field in order_field. Cursors will often be the primary IDs of object, but when ordering on another field like name, they'll be names (or another value) instead.

limitinteger

The maximum number of items to return on the page. Defaults to 100 with a minimum of 1 and a maximum of 200.

orderstring

The order of pagination. asc for ascending or desc for descending. Defaults to asc.

Enum asc, or desc.

order_fieldstring

The name of the field on which to paginate like id or name. Supported fields are specific to each endpoint, and it's not possible to specify any arbitrary name. See the documentation for each specific list endpoint to see which fields it supports. Defaults to id for most resources.

cURL example

curl -X GET https://api.crunchybridge.com/clusters/{cluster_id}/loggers
    -H "Authorization: Bearer $CRUNCHY_API_KEY"

Response

Status: 200

Response of a list cluster logger request.

Content type: application/json

NameNullableTypeDescription
loggersarray of array

Loggers configured for a cluster.

Example

{
    "loggers": [
        {
            "cluster_id": "rvf73a77ozfsvcttryebfrnlem",
            "description": "LogDNA log destination.",
            "host": "syslog-a.logdna.com",
            "host_and_port": "syslog-a.logdna.com:6514",
            "id": "s3q3zqzdr5fqbgya7xupxxpyva",
            "port": 6514,
            "team_id": "eaevtjiudzeq7bsqbbpiscund4",
            "template": "<${PRI}>1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} ${MSGID} [logdna@48950 key=\\\"MY-INGESTION-KEY\\\"] $MSG\\n"
        }
    ]
}

Create logger

Create a new logger for a cluster.

POST /clusters/{cluster_id}/loggers

Request

Path parameters

  • cluster_id: Unique ID of the cluster.

Request body schema

Content type: application/json

NameRequiredTypeDescription
hoststring

Target host of the logger.

portinteger

Target port of the logger.

templatestring

Template to use for the logger.

descriptionstring

Description of the logger.

Example request body

{
    "description": "LogDNA log destination.",
    "host": "syslog-a.logdna.com",
    "port": 6514,
    "template": "<${PRI}>1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} ${MSGID} [logdna@48950 key=\\\"MY-INGESTION-KEY\\\"] $MSG\\n"
}

cURL example

curl -X POST https://api.crunchybridge.com/clusters/{cluster_id}/loggers
    -H "Authorization: Bearer $CRUNCHY_API_KEY"
    -H "Content-Type: application/json"
    -d '{"description":"LogDNA log destination.","host":"syslog-a.logdna.com","port":6514,"template":"<${PRI}>1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} ${MSGID} [logdna@48950 key=\\\"MY-INGESTION-KEY\\\"] $MSG\\n"}'

Response

Status: 201

Responds with the standard ClusterLogger API resource.

Get logger

Get an existing logger for a cluster.

GET /clusters/{cluster_id}/loggers/{logger_id}

Request

Path parameters

  • cluster_id: Unique ID of the cluster.
  • logger_id: Unique ID of the logger.

cURL example

curl -X GET https://api.crunchybridge.com/clusters/{cluster_id}/loggers/{logger_id}
    -H "Authorization: Bearer $CRUNCHY_API_KEY"

Response

Status: 200

Responds with the standard ClusterLogger API resource.

Update logger

Update an existing logger for a cluster.

PUT /clusters/{cluster_id}/loggers/{logger_id}

Request

Path parameters

  • cluster_id: Unique ID of the cluster.
  • logger_id: Unique ID of the logger.

Request body schema

Content type: application/json

NameRequiredTypeDescription
hoststring

Target host of the logger.

portinteger

Target port of the logger.

templatestring

Template to use for the logger.

descriptionstring

Description of the logger.

Example request body

{
    "description": "LogDNA log destination.",
    "host": "syslog-a.logdna.com",
    "port": 6514,
    "template": "<${PRI}>1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} ${MSGID} [logdna@48950 key=\\\"MY-INGESTION-KEY\\\"] $MSG\\n"
}

cURL example

curl -X PUT https://api.crunchybridge.com/clusters/{cluster_id}/loggers/{logger_id}
    -H "Authorization: Bearer $CRUNCHY_API_KEY"
    -H "Content-Type: application/json"
    -d '{"description":"LogDNA log destination.","host":"syslog-a.logdna.com","port":6514,"template":"<${PRI}>1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} ${MSGID} [logdna@48950 key=\\\"MY-INGESTION-KEY\\\"] $MSG\\n"}'

Response

Status: 200

Responds with the standard ClusterLogger API resource.

Destroy logger

Delete an existing logger for a cluster.

DELETE /clusters/{cluster_id}/loggers/{logger_id}

Request

Path parameters

  • cluster_id: Unique ID of the cluster.
  • logger_id: Unique ID of the logger.

cURL example

curl -X DELETE https://api.crunchybridge.com/clusters/{cluster_id}/loggers/{logger_id}
    -H "Authorization: Bearer $CRUNCHY_API_KEY"

Response

Status: 200

Responds with the standard ClusterLogger API resource.