Splunk® Data Stream Processor

Function Reference

DSP 1.2.1 is impacted by the CVE-2021-44228 and CVE-2021-45046 security vulnerabilities from Apache Log4j. To fix these vulnerabilities, you must upgrade to DSP 1.2.4. See Upgrade the Splunk Data Stream Processor to 1.2.4 for upgrade instructions.

On October 30, 2022, all 1.2.x versions of the Splunk Data Stream Processor will reach its end of support date. See the Splunk Software Support Policy for details.

Merge Events

This topic describes how to use the function in the .

This function has been deprecated. Use the new Apply Line Break function instead.

Description

Parses data received from a universal forwarder into a stream of complete events for a Splunk Index. The universal forwarder does not parse incoming data, so you must use this function if you are using a universal forwarder. You must use merge_events in conjunction with key_by.

Function Input/Output Schema

Function Input
GroupedStream<record<K>, record<V>>
This function accepts records with schema V, grouped on schema K.
Function Output
collection<record<R>>
This function outputs a collection of records with a schema R.

Syntax

The required fields are in bold font.

merge_events
content=expression<string>
delimiter=<regular-expression>
[output=<string>]
[max_event_size=<long>]

Required arguments

content
Syntax: expression<string>
Description: An expression to get the desired field to be broken into single events.
Example in Canvas View: cast(body, "string")
delimiter
Syntax: <regular-expression>
Description: The Java regular expression used to break events.
Example in Canvas View: /(\n)[0-9]{2}-[0-9]{2}-[0-9]{4}/

Optional arguments

output
Syntax: string
Description: The name of the output field in the new event.
Default: body
Example in Canvas View: body
max_event_size
Syntax: long
Description: Specifies the maximum event size, in bytes, of an event. Size cannot exceed 1MB.
Default: 1000000 (1MB)
Example in Canvas View: 1000000

SPL2 examples

The following example assumes that you are in the SPL View. When working in the SPL View, you can write the function by providing the arguments in the exact order shown below.

Break a single event in body using a newline delimiter, and output multiple events in newfield.

...| merge_events content=cast(body, "string"), delimiter=/\n/, output=newfield, max_event_size=1000000 |...
Last modified on 08 February, 2022
Lookup   MV Expand

This documentation applies to the following versions of Splunk® Data Stream Processor: 1.2.0, 1.2.1-patch02, 1.2.1, 1.2.2-patch02, 1.2.4, 1.2.5, 1.3.0, 1.3.1, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6


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