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

Name Nullable Type Description
id string in EID format

Unique ID of the logger.

cluster_id string in EID format

The ID of cluster that the logger belongs to.

description string

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

host string

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

port integer

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

team_id string in EID format

The ID of the team that owns the associated cluster.

template string

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",
    "id": "s3q3zqzdr5fqbgya7xupxxpyva",
    "port": 6514,
    "team_id": "eaevtjiudzeq7bsqbbpiscund4",
    "template": "\u003c${PRI}\u003e1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} ${MSGID} [[email protected] key=\\\"MY-INGESTION-KEY\\\"] $MSG\\n"
}

List loggers

List existing loggers for a cluster.

GET /clusters/{cluster_id}/loggers

Request

Path parameters

  • cluster_id: Unique ID of the cluster.

cURL example

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

Response

Status: 200

Response of a list cluster logger request.

Content type: application/json

Name Nullable Type Description
loggers array of object of type ClusterLogger

Loggers configured for a cluster.

Example

{
    "loggers": [
        {
            "cluster_id": "rvf73a77ozfsvcttryebfrnlem",
            "description": "LogDNA log destination.",
            "host": "syslog-a.logdna.com",
            "id": "s3q3zqzdr5fqbgya7xupxxpyva",
            "port": 6514,
            "team_id": "eaevtjiudzeq7bsqbbpiscund4",
            "template": "\u003c${PRI}\u003e1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} ${MSGID} [[email protected] 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

Name Required Type Description
host string

Target host of the logger.

port integer

Target port of the logger.

template string

Template to use for the logger.

description string

Description of the logger.

Example request body

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

cURL example

curl -X POST https://api.crunchybridge.com/clusters/{cluster_id}/loggers
    -H "Authorization: Bearer $CRUNCHY_ACCESS_TOKEN"
    -H "Content-Type: application/json"
    -d '{"description":"LogDNA log destination.","host":"syslog-a.logdna.com","port":6514,"template":"\u003c${PRI}\u003e1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} ${MSGID} [[email protected] 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_ACCESS_TOKEN"

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

Name Required Type Description
host string

Target host of the logger.

port integer

Target port of the logger.

template string

Template to use for the logger.

description string

Description of the logger.

Example request body

{
    "description": "LogDNA log destination.",
    "host": "syslog-a.logdna.com",
    "port": 6514,
    "template": "\u003c${PRI}\u003e1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} ${MSGID} [[email protected] 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_ACCESS_TOKEN"
    -H "Content-Type: application/json"
    -d '{"description":"LogDNA log destination.","host":"syslog-a.logdna.com","port":6514,"template":"\u003c${PRI}\u003e1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} ${MSGID} [[email protected] 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_ACCESS_TOKEN"

Response

Status: 200

Responds with the standard ClusterLogger API resource.