Splunk Search

how to Transform/regex on already extracted field within same app?

koshyk
Super Champion

We have a ready made app with the configs in "default" (props & transforms).

The existing content is

[organisational_extraction_in_default]
DELIMS = ","
FIELDS = "fielda_with_complex_structure","field2","field3"

The above transform extracts perfectly, with all the fields correctly but the first field contains multiple other valuable information.
I want to further split fielda_with_complex_structure to make it into further key-value pairs. How can i create a transform on an already extracted field? I'm planning to put the new extraction login in "local", but I'm not sure how I can put the stanza name?

0 Karma
1 Solution

woodcock
Esteemed Legend

Like this:

In props.conf:

# These are executed in the same order that they appear in the list so ORDER CAREFULLY!
REPORT-mystuff = organisational_extraction_in_default, my_deeper_extraction_1, my_deeper_extraction_2, my_deeper_extraction_3

In transforms.conf:

[organisational_extraction_in_default]
DELIMS = ","
FIELDS = "fielda_with_complex_structure","field2","field3"

[my_deeper_extraction_1]
SOURCE_KEY=fielda_with_complex_structure
REGEX=(?<deep1_1>.*)

[my_deeper_extraction_2]
SOURCE_KEY=fielda_with_complex_structure
DELIMS = ","
FIELDS = deep2_1, deep2_2, deep2_3

[my_deeper_extraction_3]
SOURCE_KEY=fielda_with_complex_structure
REGEX = ^\/(?:[^\/]+\/){4}([^\/]+)
FORMAT = deep3_1::$1

View solution in original post

woodcock
Esteemed Legend

Like this:

In props.conf:

# These are executed in the same order that they appear in the list so ORDER CAREFULLY!
REPORT-mystuff = organisational_extraction_in_default, my_deeper_extraction_1, my_deeper_extraction_2, my_deeper_extraction_3

In transforms.conf:

[organisational_extraction_in_default]
DELIMS = ","
FIELDS = "fielda_with_complex_structure","field2","field3"

[my_deeper_extraction_1]
SOURCE_KEY=fielda_with_complex_structure
REGEX=(?<deep1_1>.*)

[my_deeper_extraction_2]
SOURCE_KEY=fielda_with_complex_structure
DELIMS = ","
FIELDS = deep2_1, deep2_2, deep2_3

[my_deeper_extraction_3]
SOURCE_KEY=fielda_with_complex_structure
REGEX = ^\/(?:[^\/]+\/){4}([^\/]+)
FORMAT = deep3_1::$1

koshyk
Super Champion

thanks a lot mate

0 Karma

DalJeanis
Legend

just to verify, this an index-time extraction (TRANSFORM-) , rather than a search-time extraction (REPORT-/EXTRACT-)?

0 Karma

DalJeanis
Legend

just to verify, this an index-time extraction (TRANSFORM-) , rather than a search-time extraction (REPORT-/EXTRACT-)?

0 Karma

koshyk
Super Champion

it is search-time

0 Karma
Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...