API reference
Log sources
The sources that send logs: their tokens, their settings and what they have sent.
Its operations need the scopes log_sources.edit, log_sources.view or log_sources.delete.
The Log source object
Attributes
- uuidstring
The source’s uuid.
- namestring
The source’s name.
- slugstring
The source’s slug, its identifier within the organisation.
- descriptionstring or null
The source’s description; null for none.
- source_typestring
The source’s type:
custom_source; an open set. - health_statusstring
One of
unknown,healthy,warning,critical. - last_received_atinteger or null
Epoch milliseconds. When a line last arrived; null if none ever did.
An instant: epoch milliseconds, UTC. - silence_warning_minutesinteger or null
Minutes of silence before a warning; null for the platform default.
- silence_critical_minutesinteger or null
Minutes of silence before a critical alarm; null for the platform default.
- activeboolean
Whether the source is switched on.
- has_ingest_tokenboolean
Whether a usable ingest token exists: a source created and not yet given one, or whose token was revoked, accepts no lines.
- ingest_token_last_fourstring or null
The last four characters of the token; never the token.
- ingest_token_created_atinteger or null
Epoch milliseconds. When the ingest token was minted; null if none was.
An instant: epoch milliseconds, UTC. - ingest_token_revoked_atinteger or null
Epoch milliseconds. When the ingest token was revoked; null otherwise.
An instant: epoch milliseconds, UTC. - created_atinteger or null
Epoch milliseconds. When the source was created.
An instant: epoch milliseconds, UTC. - tagsarray of objects
The source’s own tags.
- uuidstring
The tag’s uuid.
- namestring
The tag’s name.
Create a log source
POST/v1/log-sources
Creates a log source with no ingest token; mint one with the rotate-token operation. The slug defaults to a slug of the name and cannot be changed afterwards. The call is refused when the plan or the organisation’s log source limit does not allow it.
Needs the scope log_sources.edit.
Headers
- Idempotency-KeystringOptional
Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries
Idempotent-Replayed: true); the same key on a different request is refused 422invalid_request.
Body parameters
- namestringRequired
The source’s display name.
- slugstring or nullOptional
The source’s slug, a lowercase identifier of letters, digits,
.,_and-up to 100 characters; defaults to a slug of the name and cannot be changed afterwards. - descriptionstring or nullOptional
A description of the source, up to 2000 characters; null for none.
- source_typestring or nullOptional
The source’s type:
custom_source, the one type that can be created.Values:custom_source(an open set: new values may be added) - silence_warning_minutesinteger or nullOptional
Minutes without a log line before a warning, from 1 to 10080 (one week); null for the platform default.
- silence_critical_minutesinteger or nullOptional
Minutes without a log line before a critical alarm, from 1 to 10080 (one week); null for the platform default.
- activeboolean or nullOptional
Whether the source is switched on.
- tag_uuidsarray of strings or nullOptional
The uuids of the tags to put on the source.
Returns
201 Created:
The created log source.
Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.
Update a log source
PUT/v1/log-sources/{log_source_uuid}
Changes the fields sent: name, description, silence thresholds, whether it is switched on and tags. Switching a source on is refused when the plan does not allow it.
Needs the scope log_sources.edit.
Headers
- Idempotency-KeystringOptional
Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries
Idempotent-Replayed: true); the same key on a different request is refused 422invalid_request.
Path parameters
- log_source_uuidstring (uuid)Required
The uuid of the log source in the path.
Body parameters
- namestring or nullOptional
The source’s display name.
- descriptionstring or nullOptional
A description of the source, up to 2000 characters; null for none.
- silence_warning_minutesinteger or nullOptional
Minutes without a log line before a warning, from 1 to 10080 (one week); null for the platform default.
- silence_critical_minutesinteger or nullOptional
Minutes without a log line before a critical alarm, from 1 to 10080 (one week); null for the platform default.
- activeboolean or nullOptional
Whether the source is switched on.
- tag_uuidsarray of strings or nullOptional
The uuids of the tags to put on the source.
Returns
200 OK:
The log source after the update.
Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.
Get a log source
GET/v1/log-sources/{log_source_uuid}
Returns one log source with its tags and silence thresholds. The token is never returned. Reading a source also adds any default alarm the platform has introduced since it was created, as opening it in the console does.
Needs the scope log_sources.view.
Path parameters
- log_source_uuidstring (uuid)Required
The uuid of the log source in the path.
Returns
200 OK:
The log source.
Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.
List log sources
GET/v1/log-sources
Returns the organisation’s log sources. A source’s token is never returned, only whether one is set and its last four characters. Pages by page and per_page (limit is the same as per_page); every page carries current_page, per_page, last_page and total.
Needs the scope log_sources.view.
Query parameters
- limitinteger or nullOptional
The same as
per_page, kept for existing clients. - include_totalstring or nullOptional
Ignored:
totalis always present.Values:truefalse10(an open set: new values may be added) - per_pageinteger or nullOptional
The page size, from 1 to 100.
- pageinteger or nullOptional
The page to read, from 1; 1 when omitted. A page past the last answers no rows.
Returns
200 OK:
One page of the organisation’s log sources.
Each item of the page:
- uuidstring
The source’s uuid.
- namestring
The source’s name.
- slugstring
The source’s slug, its identifier within the organisation.
- descriptionstring or null
The source’s description; null for none.
- source_typestring
The source’s type:
custom_source; an open set. - health_statusstring
One of
unknown,healthy,warning,critical. - last_received_atinteger or null
Epoch milliseconds. When a line last arrived; null if none ever did.
An instant: epoch milliseconds, UTC. - activeboolean
Whether the source is switched on.
- has_ingest_tokenboolean
Whether a usable ingest token exists: a source created and not yet given one, or whose token was revoked, accepts no lines.
- ingest_token_last_fourstring or null
The last four characters of the token; never the token.
- tagsarray of objects
The source’s own tags.
- uuidstring
The tag’s uuid.
- namestring
The tag’s name.
Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.
Delete a log source
DELETE/v1/log-sources/{log_source_uuid}
Deletes the log source. The answer has no body.
Needs the scope log_sources.delete.
Headers
- Idempotency-KeystringOptional
Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries
Idempotent-Replayed: true); the same key on a different request is refused 422invalid_request.
Path parameters
- log_source_uuidstring (uuid)Required
The uuid of the log source in the path.
Returns
204 No Content:
The log source was deleted; there is no body.
Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.
Revoke a log source's token
POST/v1/log-sources/{log_source_uuid}/revoke-token
Revokes the source’s ingest token, so the source accepts no lines until a new token is minted.
Needs the scope log_sources.delete.
Headers
- Idempotency-KeystringOptional
Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries
Idempotent-Replayed: true); the same key on a different request is refused 422invalid_request.
Path parameters
- log_source_uuidstring (uuid)Required
The uuid of the log source in the path.
Returns
200 OK:
The log source after its token was revoked.
Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.
Rotate a log source's token
POST/v1/log-sources/{log_source_uuid}/rotate-token
Mints a new ingest token for the source, replacing any earlier one. The token is returned once, in this answer; a replay under the same Idempotency-Key answers it as null, so a caller that lost it rotates again under a new key.
Needs the scope log_sources.edit.
Headers
- Idempotency-KeystringOptional
Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries
Idempotent-Replayed: true); the same key on a different request is refused 422invalid_request.
Path parameters
- log_source_uuidstring (uuid)Required
The uuid of the log source in the path.
Returns
200 OK:
The new ingest token, shown once.
Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.