Splunk® Data Stream Processor

Function Reference

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.

Keyby

This topic describes how to use the function in the Splunk Data Stream Processor.

Description

Groups a stream of records by one or more field(s) and returns a grouped stream. Because Keyby outputs a GroupedBy stream, this function must be used in conjunction with Merge Events. This function does not show metrics in the UI.

Syntax

Keyby
keys=<fields>

Function Input/Output Schema

Function Input
collection<record<R>>
This function takes in collections of records with schema R.
Function Output
GroupedStream<record<K>, record<V>>
This function outputs a grouped stream of records with a given schema, K.

Required arguments

keys
syntax: <fields>
Description: The names of the fields to group records.

SPL2 example

Group records by source

...| keyby keys=source |...

Group records by source and host

...| keyby keys=[source, host] |...
Last modified on 23 March, 2020
 

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