Splunk Search

Split apart MV column into other columns

dcase999
Engager

Hi,

I have a MV field that I need to split apart into other mv fields

Here is the result of the query

dcase999_0-1624379599124.png

 

What I want it to look like is

dcase999_1-1624379947828.png

 

I've been fighting with MV commands but nothing seems to work quite like I wanted it to sooooo I figured I'd raise my hand and ask the Splunk Wizards 🙂

 

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| makeresults 
| eval Criticality=1, Application="APblah", Name="Fred Flintstone", Dependencies=split("APsomeotherblah,DNSsomething,C-Ssomeserver,C-Ssomeotherserver",",")
| table Criticality Application Name Dependencies
| eval Servers=mvfilter(match(Dependencies,"^C-S.*"))
| eval Applications=mvfilter(NOT match(Dependencies,"^C-S.*"))

View solution in original post

0 Karma

dcase999
Engager

ok, wow that is most impressive!  Many thanks @ITWhisperer !!!!

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

First of all, you can't have two columns (fields) with the same name. Secondly, how do you know which dependency is an(other) application and which is a server?

0 Karma

dcase999
Engager

ooops on the application name - you are right, that can be changed to anything else

On the "what is an application vs what is a server" question, anything that begins with C-S would be a server, anything else would be an application.

 

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| makeresults 
| eval Criticality=1, Application="APblah", Name="Fred Flintstone", Dependencies=split("APsomeotherblah,DNSsomething,C-Ssomeserver,C-Ssomeotherserver",",")
| table Criticality Application Name Dependencies
| eval Servers=mvfilter(match(Dependencies,"^C-S.*"))
| eval Applications=mvfilter(NOT match(Dependencies,"^C-S.*"))
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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...