Splunk® Data Stream Processor

Function Reference

Acrobat logo Download manual as PDF

Acrobat logo Download topic as PDF

Select

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

Description

Assigns alternative names to fields or applies scalar functions to a group of fields. Returns a new record with only the provided fields.

When using this function in the UI, you can view the record's input and output schema. For example, if you are selecting data to be normalized from the Ingest REST API, then clicking the View Configurations tab in the select function displays the default fields in the event schema. You can normalize fields using field aliases or with an eval expression.

Function Input/Output Schema

Function Input
collection<record<R>>
This function takes in collections of records with schema R.
Function Output
collection<record<S>>
This function outputs the same collection of records but with a different schema S.

Syntax

select
<expression> AS <field> ...

Required arguments

function
Syntax: collection<expression<any>>
Description: The <expression> can be either a field name or a scalar function.

Usage

This section contains additional usage information about the Select function.

Difference between Select and Eval

Both functions are used to change the fields in the record. However, while the eval function keeps existing fields and adds new fields for the aliases in the eval, select only includes the fields explicitly specified in the select function.

SPL2 example

This example keeps timestamp, id, and owner fields unchanged but renames logGroup and logStream fields.

... |select timestamp, id, owner, logGroup AS log_group, logStream AS log_stream | ...;
Last modified on 06 November, 2020
PREVIOUS
Rename
  NEXT
Stats

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