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. | |
host_and_port | string | The combined host and port separated by a colon ( | |
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",
"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
Name | Required | Type | Description |
---|---|---|---|
cursor | string | Return only items starting after this cursor ID. When paginating, pass the value of Cursor values depend on the field in | |
limit | integer | The maximum number of items to return on the page. Defaults to | |
order | string | The order of pagination. Enum | |
order_field | string | The name of the field on which to paginate like |
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
Name | Nullable | Type | Description |
---|---|---|---|
loggers | array 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
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": "<${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
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": "<${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.