JSON Logs
Last updated
Last updated
groundcover utilizes a generic HTTP endpoint for logs in JSON format. This can be useful for integration with 3rd party services and additional collectors, or for importing log files manually.
The url should be https://{incloud-site}/json/logs
as described in . Make sure to use the inCloud Managed site fit for your deployment.
HTTP method should be set to POST. No other methods are supported.
To authenticate the request you can use any of the methods described .
The most simple method is using an apikey
header with your apikey, which can be fetched using the command groundcover auth print-api-key
.
See example for more details.
One request can contain multiple logs by setting the payload as a JSON array (where every entry is a log line) or by using ndjson
. Make sure to set the Content-Type
header appropriately.
JSON array
application/json
ndjson
application/x-ndjson
groundcover parses JSON logs using this logic:
Timestamp is extracted from the either of the keys timestamp
, time
or ts
. It is recommended to use RFC 3339 Nano format.
Log message is extracted from either of the keys message
, msg
, log
, body
, content
or text
Additional fields will be stored as log attributes.
This curl
command sends two log lines to an example groundcover backend:
It is recommended to add the following attributes to your logs to enrich them, associating them with common groundcover concepts and making them easier to find and filter.
service.name
Workload
clusterId
Cluster
env_name
Env
gc_source_type
Source
namespace
Namespace
For example: