Publish Server or Audit Logs to an External Service
MinIO publishes all silo server operations to the system console. Reading these logs depends on how the server process is managed. For example, if the server is managed through a systemd script, you can read the logs using journalctl -u SERVICENAME.service. Replace SERVICENAME with the name of the MinIO service.
MinIO also supports publishing server logs and audit logs to an HTTP webhook.
- Server logs contain the same
silo serveroperations logged to the system console. Server logs support general monitoring and troubleshooting of operations. - Audit logs are more granular descriptions of each operation on the MinIO deployment. Audit logging supports security standards and regulations which require detailed tracking of operations.
MinIO publishes logs as a JSON document in a PUT request to each configured endpoint. The endpoint server processes each JSON document. MinIO requires explicit configuration of each webhook endpoint and does not publish logs to a webhook by default.
When configured through mc admin config set, SILO dynamically reloads logger_webhook, audit_webhook, and audit_kafka targets across all cluster nodes without requiring a full cluster restart (environment variables set at process startup take precedence and still require a restart when changed). In SILO 20261109, peer configuration reloads keep active audit_webhook, logger_webhook, and audit_kafka targets running on every server node under the server process lifecycle instead of stopping target workers on peer nodes after the reload call returns (#259).
Publish Server Logs to HTTP Webhook
You can configure a new HTTP webhook endpoint to which MinIO publishes silo server logs using either environment variables or runtime configuration settings.
MinIO supports specifying the silo server log HTTP webhook endpoint and associated configuration settings using environment variables.
The following example sets all environment variables related to configuring a log HTTP webhook endpoint. The minimum required variables are:
-
Replace
<IDENTIFIER>with a unique descriptive string for the HTTP webhook endpoint. Use the same<IDENTIFIER>for all environment variables related to the new log HTTP webhook.If the specified
<IDENTIFIER>matches an existing log endpoint, the new settings override any existing settings for that endpoint. Usemc admin config get logger_webhookto review the currently configured log HTTP webhook endpoints. -
Replace
https://webhook-1.example.netwith the URL of the HTTP webhook endpoint. -
Replace
TOKENwith an authentication token of the appropriate type for the endpoint. Omit for endpoints which do not require authentication.
To allow for a variety of token types, MinIO creates the request authentication header using the value exactly as specified. Depending on the endpoint, you may need to include additional information.
For example, for a Bearer token, prepend Bearer:
Modify the value according to the endpoint requirements. A custom authentication format resembles the following:
Consult the documentation for the target service for more details.
Restart the SILO server to apply environment variable changes. Specify identical environment variables on all SILO servers in the deployment.
SILO supports adding or updating log HTTP webhook endpoints using the mc admin config set command and the logger_webhook configuration key. When not overridden by MINIO_LOGGER_WEBHOOK_* environment variables, SILO reloads logger_webhook dynamically across all cluster nodes without a full restart; in SILO 20261109, peer nodes keep reloaded targets running continuously (#259).
The following example sets all settings related to configuring a log HTTP webhook endpoint. The minimum required setting is logger_webhook endpoint:
-
Replace
IDENTIFIERwith a unique descriptive string for the HTTP webhook endpoint.If the specified
IDENTIFIERmatches an existing log endpoint, the new settings override any existing settings for that endpoint. Usemc admin config get logger_webhookto review the currently configured log HTTP webhook endpoints. -
Replace
https://webhook-1.example.netwith the URL of the HTTP webhook endpoint. -
Replace
TOKENwith an authentication token of the appropriate type for the endpoint. Omit for endpoints which do not require authentication.To allow for a variety of token types, MinIO creates the request authentication header using the value exactly as specified. Depending on the endpoint, you may need to include additional information.
For example, for a Bearer token, prepend
Bearer:Modify the value according to the endpoint requirements. A custom authentication format resembles the following:
Consult the documentation for the target service for more details.
Publish Audit Logs to HTTP Webhook
You can configure a new HTTP webhook endpoint to which MinIO publishes audit logs using either environment variables or runtime configuration settings:
MinIO supports specifying the audit log HTTP webhook endpoint and associated configuration settings using environment variables.
The following example sets all environment variables related to configuring an audit log HTTP webhook endpoint. The minimum required variables are:
-
Replace
<IDENTIFIER>with a unique descriptive string for the HTTP webhook endpoint. Use the same<IDENTIFIER>for all environment variables related to the new audit log HTTP webhook.If the specified
<IDENTIFIER>matches an existing log endpoint, the new settings override any existing settings for that endpoint. Usemc admin config get audit_webhookto review the currently configured audit log HTTP webhook endpoints. -
Replace
https://webhook-1.example.netwith the URL of the HTTP webhook endpoint. -
Replace
TOKENwith an authentication token of the appropriate type for the endpoint. Omit for endpoints which do not require authentication.
To allow for a variety of token types, MinIO creates the request authentication header using the value exactly as specified. Depending on the endpoint, you may need to include additional information.
For example, for a Bearer token, prepend Bearer:
Modify the value according to the endpoint requirements. A custom authentication format resembles the following:
Consult the documentation for the target service for more details.
- Replace
cert.pemandcert.keywith the public and private key of the X.509 TLS certificates to present to the HTTP webhook server. Omit for endpoints which do not require clients to present TLS certificates.
Restart the SILO server to apply environment variable changes. Specify identical environment variables on all SILO servers in the deployment.
SILO supports adding or updating audit log HTTP webhook endpoints using the mc admin config set command and the audit_webhook configuration key (and similarly reloads audit_kafka audit targets dynamically). When not overridden by MINIO_AUDIT_WEBHOOK_* environment variables, SILO applies audit_webhook changes dynamically across all cluster nodes without restarting the deployment; in SILO 20261109, peer configuration reloads preserve active audit_webhook and audit_kafka workers and queue_dir delivery queues on every node (#259).
The following example sets all settings related to configuring an audit log HTTP webhook endpoint. The minimum required setting is audit_webhook endpoint:
-
Replace
IDENTIFIERwith a unique descriptive string for the HTTP webhook endpoint.If the specified
IDENTIFIERmatches an existing log endpoint, the new settings override any existing settings for that endpoint. Usemc admin config get audit_webhookto review the currently configured audit log HTTP webhook endpoints. -
Replace
https://webhook-1.example.netwith the URL of the HTTP webhook endpoint. -
Replace
TOKENwith an authentication token of the appropriate type for the endpoint. Omit for endpoints which do not require authentication.To allow for a variety of token types, MinIO creates the request authentication header using the value exactly as specified. Depending on the endpoint, you may need to include additional information.
For example, for a Bearer token, prepend
Bearer:Modify the value according to the endpoint requirements. A custom authentication format resembles the following:
Consult the documentation for the target service for more details.
-
Replace
cert.pemandcert.keywith the public and private key of the X.509 TLS certificates to present to the HTTP webhook server. Omit for endpoints which do not require clients to present TLS certificates.
Audit Log Structure
MinIO audit logs resemble the following JSON document:
-
The
api.timeToFirstByteandapi.timeToResponsefields are expressed in nanoseconds. -
For erasure coded setups
tags.objectErasureMapprovides per-object details on the following:- The Server Pool on which the object operation was performed.
- The erasure set on which the object operation was performed.
- The list of drives in the erasure set which participated in the object operation.