Configuring Splunk log collection
Splunk Log Collection is a logging integration that allows the Virtana Platform to forward application logs, traces, and metadata to an external Splunk instance. When enabled, logs generated by both the frontend and backend services are streamed to your Splunk environment, enabling centralized log management.
Enabling Splunk Log Collection aggregates logs from all Virtana Platform services into a single Splunk instance for unified visibility. It quickly searches and correlates logs across pods, namespaces, and containers to diagnose issues. It leads to setting up Splunk alerts and dashboards based on real-time log data from your clusters.
By default, the platform does not send logs to Splunk. You need to configure this if your organization uses Splunk as its log management solution and wants to integrate Virtana Platform logs into it.
To enable Splunk Log Collection, set the log_source parameter to splunk in your Helm chart values files and configure the required parameters below. Configuration is split across two files:
Frontend values.yaml: Contains connection details, headers, labels, SSL, and trace settings.Backend values.yaml: Contains the cluster name and Splunk index definitions.
Configuration values file
global:
log_config:
log_source: splunk
splunk_external_url: ""
splunk_custom_headers: ""
splunk_params: ""
splunk_label_configs:
cluster_name: "cluster_name"
pod: "pod"
namespace: "namespace"
node: "node"
container_name: "container_name"
spanID: ""
traceID: ""
splunk_enable_ssl_context: false
splunk_auth_token: ""
splunk_trace_params: ""
splunk_cluster_name: ""
splunk_indexes:
# - main
# - prodThe following table describes each field in the configuration file.
Field | Description | Default value |
|---|---|---|
General parameter | ||
| The logging backend to use. When set to | |
Frontend parameters | ||
| The URL of your external Splunk HTTP Event Collector (HEC) endpoint. |
|
| Comma-separated custom HTTP headers to include in requests to Splunk. |
|
| Additional query parameters appended to Splunk log requests. |
|
| A mapping of Kubernetes metadata labels to include with each log entry sent to Splunk. | |
| Label key for the Kubernetes cluster name. |
|
| Label key for the pod name that generated the log. |
|
| Label key for the Kubernetes namespace. |
|
| Label key for the Kubernetes node where the pod is running. |
|
| Label key for the container name within the pod. |
|
| Label key for the distributed trace span ID. |
|
| Label key for the distributed trace ID. |
|
| Set to |
|
| The authentication token for the Splunk HEC endpoint. |
|
| Filter parameters for trace data sent to Splunk. |
|
Backend parameters | ||
| The name of the Kubernetes cluster as it should appear in Splunk. | "" |
| A list of Splunk index names where logs should be stored. | [] |
Getting started
Perform the following steps:
Obtain a Splunk HEC token and endpoint URL from your Splunk administrator.
Set
log_source: splunkunderglobal.log_config.In your frontend
values.yaml, providesplunk_external_urlandsplunk_auth_tokenat minimum.In your backend
values.yaml, setsplunk_cluster_nameand optionally definesplunk_indexes.Deploy or upgrade your Helm release with the updated values files.
Verify logs are arriving in Splunk by searching for entries tagged with your cluster name.