Splunk Search

split filed into multiple filed

abhijeet
Explorer

I would like to break "X" field into multiple field based on available value. "X" contain data in following format. 

Field X-

ABC: YES, APPLICATION: DEF, ZONE: DATA, ENVIRONMENT: DEV

ZONE: INSIDE, ENVIRONMENT: PROD

ZONE: OUTSIDE, ENVIRONMENT: DEV, ABC: YES, APPLICATION: IJK

=======

I would like the arrange data in following format.

 

ABC     APPLICATION             ZONE           ENVIRONMENT

YES           DEF                          DATA                      DEV

                                                     INSIDE                  PROD

YES           IJK                           OUTSIDE             DEV

 

TIA. 

 

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

The bit before the blank lines just sets up dummy data for the runanywhere example

| makeresults 
| eval X=split("ABC: YES, APPLICATION: DEF, ZONE: DATA, ENVIRONMENT: DEV|ZONE: INSIDE, ENVIRONMENT: PROD|ZONE: OUTSIDE, ENVIRONMENT: DEV, ABC: YES, APPLICATION: IJK","|")
| mvexpand X


| eval _raw=X
| extract pairdelim="," kvdelim=":"

 

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

The bit before the blank lines just sets up dummy data for the runanywhere example

| makeresults 
| eval X=split("ABC: YES, APPLICATION: DEF, ZONE: DATA, ENVIRONMENT: DEV|ZONE: INSIDE, ENVIRONMENT: PROD|ZONE: OUTSIDE, ENVIRONMENT: DEV, ABC: YES, APPLICATION: IJK","|")
| mvexpand X


| eval _raw=X
| extract pairdelim="," kvdelim=":"

 

abhijeet
Explorer

Thank you so much. Solution works... 

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...