Splunk® Data Stream Processor

Function Reference

Acrobat logo Download manual as PDF

Acrobat logo Download topic as PDF


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


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



Function Input/Output Schema

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

Required arguments

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

SPL2 example

Group records by source

...| key_by keys=source |...

Group records by source and host

...| keyby keys=[source, host] |...
Last modified on 02 July, 2020
Merge Events

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

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