For the complete documentation index, see llms.txt. This page is also available as Markdown.

Add a Splunk connector

Add a Splunk connector so Harness can fetch logs from your Splunk deployment for verification.

Splunk is a data platform that collects, indexes, and searches machine data such as application logs and events, available as Splunk Enterprise (self-hosted) and Splunk Cloud Platform. Add a Splunk connector in Harness to let your pipelines run searches against your Splunk logs. Harness can then use that data in Continuous Verification to compare log patterns and detect anomalies after a deployment, helping you confirm a release is healthy or trigger a rollback.

Go to Overview for information about all monitoring and logging connectors, such as scopes and delegate selection.


What you will learn from this topic


Before you begin

  • Splunk REST API access: A non-SAML Splunk account with access to the REST API on the Splunk server.

  • Harness permissions: Permission to create connectors and secrets in Harness.


Splunk account permissions

Splunk APIs require you to authenticate with a non-SAML account. To access your Splunk Cloud deployment using the Splunk REST API and SDKs, submit a support case requesting access on the Splunk Support Portal.

  • Managed deployments: Splunk Support opens port 8089 for REST access. You can specify a range of IP addresses for controlled access to the REST API.

  • Self-service deployments: Splunk Support defines a dedicated user and sends you credentials that enable that user to access the REST API.

Go to Using the REST API with Splunk Cloud in the Splunk documentation for details.

The Splunk user account that authenticates Harness must belong to a role with the following capabilities:

  • Search: Permission to run searches.

  • Index access: Access to the indexes you want to search.

The following example shows a Splunk role named Harness User that has the search capability.

Splunk role with search capability

The example role has access to All non-internal indexes. You can restrict the role to only the relevant indexes.

Splunk role index access settings

Add a Splunk connector

You can add a Splunk connector at the project, org, or account scope. This procedure covers the project scope, and the process is the same for org and account scope.

  1. Open your Harness project.

  2. In Project Settings, select Connectors.

  3. Click New Connector, then select Splunk under Monitoring and Logging Systems. The Splunk connector settings appear.

Overview

Configure the identity fields for the connector.

  1. In Name, enter a name for the connector. Harness generates the Id from the name.

  2. Optionally, add a Description and Tags.

  3. Click Continue.

Splunk connector overview settings

Credentials

Configure the following settings:

  1. In URL, enter the URL to access the REST API on the Splunk server, including the port number. The default port is 8089. For example, https://deployment-name.cloud.splunk.com:8089 or https://mycompany.splunkcloud.com:8089.

  2. In Authentication, select one of the following options:

    • Username and Password:

    • Bearer Token (HTTP Header): A bearer token is an authentication token you send in the HTTP Authorization header, instead of a username and password, when calling the REST API. Select or create a Harness encrypted text secret to store the authentication token.

    • No Authentication: Connect without credentials. Use this option only when your Splunk server does not require authentication.

    • HEC Authentication: An HEC token is the credential for Splunk’s HTTP Event Collector (HEC). HEC lets you send data and application events to a Splunk deployment over HTTP or HTTPS. Select or create a Harness encrypted text secret to store the HEC token.

  3. Click Connect and Save.

Splunk connector credentials with the URL, authentication, username, and password fields

Delegates Setup

Select one of the following options:

  • Use any available Delegate: Harness selects an available delegate at runtime.

  • Only use Delegates with all of the following tags: Enter the tags of the delegates Harness must use with this connector.

The Test Delegate Connectivity list shows the delegates that match your selection. To add a delegate, click Install new Delegate.

Click Save and Continue.

Splunk connector delegates setup with the delegate connectivity list

Verify Connection

Click Finish after the connection test succeeds. The connector is listed in Connectors page.


Sample YAML

The following example shows a YAML for the Splunk connector created in this topic.

YAML - Splunk connector

For the full connector YAML schema, including how to skip connector preflight checks, go to Create a connector using YAML.


Next steps

Last updated

Was this helpful?