Splunk® Data Stream Processor

Use the Data Stream Processor

Acrobat logo Download manual as PDF


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.
Acrobat logo Download topic as PDF

Adding, removing, and updating fields

You can add, update, and remove fields at ingestion time with the Data Stream Processor.

Adding fields

To add a new top-level field to your data, use the Eval function. The Eval function adds or updates an existing field to your record.

  1. From the Data Pipelines editor, click on the + icon and add the Eval function to your pipeline.
  2. Enter the Eval expression that defines the field value.
    For example, to add a new field called "User" to your data that contains the value of host, type as(get("host"), "User"); in your eval function.
  3. With your Eval function highlighted, click Start Preview to verify that the expression is working as expected.

Updating fields

To manipulate an existing field, use the Eval function. The Eval function adds or updates an existing field to your record.

  1. From the Data Pipelines editor, click on the + icon and add the Eval function to your pipeline.
  2. Enter the Eval expression that defines the field value.
    For example, to append to the existing body field Price, type the following in your Eval function.
    as(
        concat(
            literal("price="),
            cast(get("body"), "string")
        ),
        "body"
    );
     
  3. With your Eval function highlighted, click Start Preview to verify that the expression is working as expected.

Removing fields

To remove fields from your data, use the Fields or Normalize functions.

Use the Fields function to only keep selected fields in your events.

  1. From the Data Pipelines Canvas view, click on the + icon and add the Fields function to your pipeline.
  2. In the Fields function, enter the fields you want to keep in your data.
    For example, to keep only the host and source fields, type host, click Add, and type source.
  3. With your Fields function highlighted, click Start Preview to verify that the expression is working as expected.

Use the Normalize function to remove fields in your events

  1. From the Data Pipelines Canvas view, click on the + icon and add the Normalize function to your pipeline.
  2. In the Normalize function, click Delete on the fields that you want to remove.
  3. With your Normalize function highlighted, click Start Preview to verify that the expression is working as expected.
Last modified on 05 March, 2020
PREVIOUS
Add a sourcetype
  NEXT
Extracting fields

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


Was this documentation topic helpful?


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