Skip to main content

 

Splunk Lantern

Improving your data management with SPL2 pipelines

Whether you're a Splunk Enterprise or Splunk Cloud Platform customer, the Splunk data management experience will improve the way you onboard, transform, and archive data, helping you get more value from the Splunk platform. Data management is accomplished through a single, modern UI experience (on a search head for on-premises customers or in your cloud stack) that includes an SPL2 Pipeline editor with more than 50 data source templates for a quick start, deployment through Splunk Edge Processor or Splunk Ingest Processor, and monitoring and troubleshooting assistance.

This article focuses on the basics of the SPL2 pipeline, but before we begin, let's do a quick review of the management deployment options. Which one you use impacts your pipeline creation. 

Splunk Ingest Processor

Available to Splunk Cloud Platform customers, Ingest Processor applies filtering, masking, transforming, and converting functions at the time of data ingestion. Then it routes your data to Splunk Cloud Platform, Splunk Observability Cloud, S3 buckets, or Azure, according to your pipeline.

clipboard_26634e1d-a2d5-4cd0-af32-7c462dac1e3f.png

If you are using Splunk Ingest Processor, this quick reference for SPL2 commands will be helpful.

Splunk Edge Processor

Available to both Splunk Cloud Platform and Splunk Enterprise customers, Edge Processor applies filtering, masking, transforming, and converting functions, before routing data to the Splunk platform, S3 buckets, or Azure, according to your pipeline. It is customer-hosts, which gives you control at the edge before data leaves your network, a benefit for security-conscious environments. 

clipboard_f5ddee48-8e8e-4c7c-8afd-9c8a6909913e.png

If you are using Splunk Edge Processor, this quick reference for SPL2 commands will be useful. 

SPL2 pipelines

SPL2 pipelines have three main components:

  • Partition. The type of data: source type, source, host, or index.
  • Pipeline. A sequence of instructions written in SPL2. This section includes actions on data, such as routing, cloning, and extracting fields. Using one of the templates for common data sources is the easiest way to get started, but the pipeline editor includes error warnings and previews to help you verify that you have crafted an effective pipeline. 
  • Destination. Where the transformed data will go. Note that you can only send data to Splunk Observability Cloud from Splunk Ingest Processor, and you can only send data to Splunk Enterprise from Splunk Edge Processor.

clipboard_9fd089b3-97d8-4f83-8f25-4d37d2a14e97.png

Common use cases for SPL2 pipelines

Use the SPL2 quick reference guides linked above to learn how to create pipelines to achieve the following common business goals. A common sample pipeline is provided after the table.

Typical use case Example commands Business value
  • Regex field extraction PCRE
  • Basic PII masking
  • Filtering noisy events

eval

rex

where

fields

rename

lookup

Cost optimization by reducing logs

Immediate reduction in license consumption by 
dropping low-value data at the source.

Object manipulation

spath (JSON or XML)

expand

flatten

map

mvexpand

reduce

union

Data quality

Normalizing unstructured or complex JSON logs 
into a flat, CIM-compliant format for better 
downstream analytics.

  • Routing
  • Cloning
  • Encrypting

branch

thru

decrypt

custom functions

Compliance and security

Implementing end-to-end data sovereignty by 
encrypting/decrypting sensitive fields and 
maintaining "Golden Copy" archives in low-cost 
storage.

Example SPL2 pipeline

Let's say you want to remove all fields from a JSON payload that are empty. It might not seem that keys with null values are a big deal, but when you think about the impact of collecting this data over hundreds of thousands of events, you'll realize how much unnecessary bandwidth and storage empty fields consume. A pipeline to achieve this goal would look like the following:

function clean_up_empty_events($source: dataset): dataset {
   return  | from $source
   | eval array_null_keys=filter(json_keys(_raw), json_extract(_raw, $it) == "")
   | eval _raw = json_delete(_raw,array_null_keys)
   | fields - array_null_keys
}
$pipeline = | from $source | eval index = "json_filtered"
| clean_up_empty_events
| into $destination;

Function defined

function clean_up_empty_events($source: dataset): dataset {
   return  | from $source
   | eval array_null_keys=filter(json_keys(_raw), json_extract(_raw, $it) == "")
   | eval _raw = json_delete(_raw,array_null_keys)
   | fields - array_null_keys

The first eval statement filters null values, gets the keys, and iterates on every element and the second eval does the removal. 

Pipeline definition

$pipeline = | from $source | eval index = "json_filtered"
| clean_up_empty_events
| into $destination;

This section sets the index for the events, calls the function defined above, and specifies the destination.

Next steps

Now that you are ready to get started with data management and SPL2, watch the full talk from Cisco Live EMEA 2026, Unlocking Value: Advanced Data Management with Splunk and Cisco Data Fabric. In the talk, you'll learn good data classification strategies, hear real customer success stories with Splunk data management, and get a preview of AI features that can help you work even more effectively.

You might also be interested in the following data management articles: