Logging Configuration
Each Hydrolix cluster runs an instance of Vector which collects logs from Hydrolix applications in the same Kubernetes namespace and transmits the data to the configured destinations.
This page describes how to configure the logging output generated by applications in a Hydrolix cluster.
If you would like to send data to your Hydrolix cluster using Vector, see Vector Integration.
Log collection⚓︎
Logs are always collected from the Hydrolix cluster's namespace.
To collect application logging from other namespaces in the Kubernetes cluster, list the other namespaces in the vector_extra_namespaces Hydrolix Tunable.
Applications in other namespaces may not uniformly produce JSON log lines. The vector configuration differentiates between two different types of log messages, those that appear to be JSON and those that don't.
Log messages that begin with { are interpreted as JSON. Fields that can't be mapped to common Hydrologs fields are stored in the catchall column.
Log messages that don't begin with { are interpreted as text. The entire log line is stored in the message column.
The original namespace in the Kubernetes cluster is collected. The column kubernetes.pod_namespace in a hydro.logs table contains the namespace name.
In Vector terminology, these are all Kubernetes logs source.
Log destinations⚓︎
By default, Hydrolix application logs are sent to Hydrologs, stored in each cluster's hydro.logs table, and also stored as compressed files in the object store filesystem.
A pod running an instance of Vector collects logs from all Hydrolix applications in Kubernetes and transmits the data to the configured destinations.
The destination, method of delivery, and choice of authentication are all configurable. The Hydrolix logging configuration supports compressed file delivery to object storage and streaming through an HTTP sink.
| Destination | Method of Delivery | Authentication | Enabled | Notes |
|---|---|---|---|---|
| Object store filesystem | Compressed files stored in primary object store | no | yes | files named log/$POD/$CONTAINER |
| Local Hydrologs | Logs streamed to local Hydrolix intake heads | no | yes | http://hydrologs-intake-head:8089/ingest/event |
| Remote Hydrolix endpoint | Logs streamed to a remote HTTP endpoint | recommended | no | Example, another Hydrolix cluster |
Any combination of the three types of destinations is a valid configuration.
Log configuration⚓︎
Configure Hydrolix logs destination in your hydrolixcluster.yaml:
Object store filesystem⚓︎
To suppress storage of the gzip-compressed log data in the object store filesystem, set the Hydrolix tunable disable_vector_bucket_logging to true.
Local Hydrolix endpoint⚓︎
The local in-cluster Hydrolix endpoint, http://hydrologs-intake-head:8089/ingest/event, can't be configured.
Remote Hydrolix endpoint⚓︎
Specify a remote Hydrolix stream ingestion endpoint.
| Destination | Description |
|---|---|
https://{myhost}.hydrolix.live/ingest/event |
Send to the default ingest pools of a remote cluster |
https://{myhost}.hydrolix.live/pool/{custom_ingest_pool}/ingest/event |
Send to a custom ingest pool of a remote cluster. See Resource Pools |
Example configurations⚓︎
The fragment below demonstrates the use of HTTP Basic Access Authentication to an HTTP Stream API.
Hydrolix also supports service accounts since v5.4. Follow the Service Accounts How-to to create a long-lifetime auth token.
Remote HTTP with basic auth⚓︎
Credential management⚓︎
When sending your logs to an external sink, you will usually need to provide authentication credentials.
Hydrolix uses a secret called curated to hold administratively managed values that are merged into the cluster configuration.
Set these values using a Kubernetes Secret. Use the Kubectl tool for interacting with the Kubernetes Secret store.
Create or modify the curated secret using one of the following commands and add the required variables, depending on your selection of basic or token auth type.
Use basic authentication credentials⚓︎
This configures vector to present HTTP Basic Access Authentication in the Authorization header when connecting to the remote log endpoint.
- Set
logs_http_remote_auth_enabledtotrue. - (optional) Set
logs_http_remote_auth_typeexplicitly tobasic, which is the default. - Install the basic authentication credentials in the
curatedsecret in varables namedLOGS_HTTP_AUTH_USERNAMEandLOGS_HTTP_AUTH_PASSWORD.
Use OAuth2 bearer token⚓︎
This configures vector to present an OAuth 2.0 bearer token in the Authorization header when connecting to the remote log endpoint.
- Set
logs_http_remote_auth_enabledtotrue. - Set
logs_http_remote_auth_typetotoken. - Install the token into the
curatedsecret in a variable namedLOGS_HTTP_AUTH_TOKEN.
Create a curated secret⚓︎
When creating an Opaque Secret, use the generic subcommand.
Name the new secret curated where the Hydrolix operator expects it.
During secret creation, the tooling transparently base64 encodes the values.
Display a curated secret⚓︎
Confirm the secret was successfully created for the namespace containing your cluster by running the following command:
Edit a curated secret⚓︎
When editing secrets
Which should open a file with contents similar to:
The operator pod collects secrets from curated and merges them into the dynamically-generated general secret.
Then it constructs a configuration file for the vector application and pod, defining an HTTP sink including the remote endpoint and credentials.
Log level⚓︎
The log_level setting designates custom log levels for the services in a Hydrolix cluster.
Specify a YAML dictionary with Hydrolix service names or the wildcard string “*” as keys. Service name keys take precedence over the default wildcard key.
The example below sets all services that respect this setting to the info level except for stream-head and query-head, which are set to use the critical and trace setting, respectively:
Valid log level values:
criticalerrorwarninginfodebugtrace
Values are case-insensitive.
Below is a list of services that support the log_level setting. Services not on this list ignore this setting.
akamai-siem-indexerakamai-siem-peeralteralter-headalter-indexerautoingestbatch-headbatch-indexerbatch-peerdecayhdx-scalerintake-apiintake-headintake-indexerjob-purgekafka-indexerkafka-peerkinesis-indexerkinesis-peerlog-vacuummergemerge-cleanupmerge-controllermerge-headmerge-indexermerge-peerpartition-vacuumprune-locksquery-headquery-peerreaperrejects-vacuumstale-job-monitorstream-headstream-indexerstream-peersummary_peersummary-indexertask-monitorturbine-apivalidatorvalidator-indexer