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!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...