Splunk® Data Stream Processor

Getting Data In

On April 3, 2023, Splunk Data Stream Processor will reach its end of sale, and will reach its end of life on February 28, 2025. If you are an existing DSP customer, please reach out to your account team for more information.
This documentation does not apply to the most recent version of Splunk® Data Stream Processor. For documentation on the most recent version, go to the latest release.

Create and manage DSP HEC tokens with SCloud

DSP HEC Tokens are entities that let logging agents and HTTP clients connect to DSP. When the clients connect, they present this token. If the DSP HEC receives a valid token, it accepts the connection, and the client delivers its payload of application events in JSON format.

Splunk HEC tokens will not work with DSP HEC. You must create a new token for DSP HEC.

  • DSP HEC token names must be lower case and must not contain special characters.
  • DSP HEC token names must be 4-36 characters in length.
  • The user must have the ingest.admin role for the tenant.

The generated DSP HEC token is only returned once. You can't retrieve the token at a later date.

You can create DSP HEC tokens with either the Ingest REST API or with SCloud. See the Splunk Data Stream Processor REST API Reference for more information about the DSP REST API. See Get started with SCloud for more information about SCloud.

You must have SCloud version 3.0.0 or higher to use SCloud to generate DSP HEC tokens.

Create a DSP HEC token with SCloud

The following example demonstrates how to use SCloud to create a DSP HEC token.

./scloud ingest post-collector-tokens --name <dsphec-token-name> --tenant default

The generated DSP HEC token is only returned once. You can't retrieve the token at a later date.

A typical response when you create a DSP HEC token using SCloud looks like this:

{
    "created_at": "2020-04-24T19:31:17.578536102Z",
    "created_by": "name@example.com",
    "last_modified_at": "2020-04-24T19:31:17.578536102Z",
    "last_modified_by": "name@example.com",
    "name": "<dsphec-token-name>",
    "tenant": "default",
    "token": "<dsphec-token>"
}

Verify that the DSP HEC token is working in your DSP pipeline

You can verify that the DSP HEC token is working in your DSP pipeline with the pipeline preview.

  1. Create a new pipeline in DSP. See Create a pipeline using the Canvas Builder for more information on creating a new pipeline.
  2. Add Read from Splunk Firehose as your data source.
  3. Click Start Preview.
  4. Use your HTTP client to send the following HTTP request:
    curl -X POST "https://<DSP_HOST>:31000/services/collector/event" \
       -H "Authorization: Splunk <dsphec-token>" \
       -d '{
       "event": "Hello, world!",
       "sourcetype": "manual"
    }'

You can now see the test event in the pipeline preview.

Update a DSP HEC token by name with SCloud

The following example demonstrates how to use SCloud to update a DSP HEC token.

./scloud ingest put-collector-token --token-name <dsphec-token-name> --description "A token for the clients in us-west datacenter 1" --tenant default

A typical response when you update the MetaData for a DSP HEC token using SCloud looks like this:

{
    "created_at": "2020-04-24T19:31:17.578536Z",
    "created_by": "name@example.com",
    "description": "A token for the clients in us-west datacenter 1",
    "last_modified_at": "2020-04-24T19:39:11.921962Z",
    "last_modified_by": "name@example.com",
    "name": "<dsphec-token-name>",
    "tenant": "default"
}

Get the MetaData for a DSP HEC token by name with SCloud

The following example demonstrates how to use SCloud to get the MetaData from a DSP HEC token.

./scloud ingest get-collector-token --name <dsphec-token-name> --tenant default

A typical response when you request the MetaData for a DSP HEC token using SCloud looks like this:

{
    "created_at": "2020-04-24T19:31:17.578536Z",
    "created_by": "name@example.com",
    "description": "A token for the clients in us-west datacenter 1",
    "last_modified_at": "2020-04-24T19:39:11.921962Z",
    "last_modified_by": "name@example.com",
    "name": "<dsphec-token-name>",
    "tenant": "default"
}

List all DSP HEC tokens with SCloud

The following example demonstrates how to use SCloud to list all DSP HEC tokens.

./scloud ingest list-collector-tokens

A typical response when you list all DSP HEC tokens looks like this:

[
    {
        "created_at": "2020-04-24T19:31:17.578536Z",
        "created_by": "name@example.com",
        "last_modified_at": "2020-04-24T19:39:11.921962Z",
        "last_modified_by": "name@example.com",
        "name": "<dsphec-token-name-01>",
        "tenant": "default"
    },
    {
        "created_at": "2020-04-07T18:18:29.430245Z",
        "created_by": "name@example.com",
        "last_modified_at": "2020-04-07T18:18:29.430245Z",
        "last_modified_by": "name@example.com",
        "name": "dsphec-token-name-02",
        "tenant": "default"
    }
]

Delete a DSP HEC token by name with SCloud

The following example demonstrates how to use SCloud to delete a specific DSP HEC token.

./scloud ingest delete-collector-token --token-name <dsphec-token-name> --tenant default

Delete all DSP HEC tokens with SCloud

The following example demonstrates how to use SCloud to delete all DSP HEC tokens.

./scloud ingest delete-all-collector-tokens --tenant default
Last modified on 04 September, 2020
Create and manage DSP HEC tokens with the Ingest REST API   Use the Splunk HEC API to send events and metrics to a DSP pipeline

This documentation applies to the following versions of Splunk® Data Stream Processor: 1.1.0


Was this topic useful?







You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters