Splunk Search

How to modify rows and columns in the Splunk table?

kiril123
Path Finder

Hello,

I have written a splunk search which produces the following table:

from    to  parameter   value
A       C    bla_1       111
B       D    bla_2       222

I want to modify that table into the following:

from    to  value
A   bla_1   111
B   bla_2   222
bla_1   C   111
bla_2   D   222

Would you have any ides on how to achieve this?

Thank you.

0 Karma
1 Solution

DalJeanis
SplunkTrust
SplunkTrust

Try this...

(your search)
| eval myfan=mvrange(0,2)
| mvexpand myfan 
| eval from=if(myfan=0,from,parameter)
| eval to=if(myfan=0,parameter,to)
| fields - parameter

View solution in original post

DalJeanis
SplunkTrust
SplunkTrust

Try this...

(your search)
| eval myfan=mvrange(0,2)
| mvexpand myfan 
| eval from=if(myfan=0,from,parameter)
| eval to=if(myfan=0,parameter,to)
| fields - parameter

kiril123
Path Finder

This has worked for me. Thank you.

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...