Splunk Search

How to make from one row two?

andrey2007
Contributor

Hello All
My table looks like these

Number Name Position Login1 Login2

1 John expert johns1 johns2

is it possible to make another table which looks like
Number Name Position Login
1 John expert johns1
2 John expert johns2

Thanks for all answers!

Tags (1)
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

If you have just two fields you can do this:

base search | eval Login = Login1."###".Login2 | fields - Login1 Login2 | makemv delim="###" Login | mvexpand Login

View solution in original post

krish3
Contributor

try using transpose to your result..

....your search |table....|transpose
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

If you have just two fields you can do this:

base search | eval Login = Login1."###".Login2 | fields - Login1 Login2 | makemv delim="###" Login | mvexpand Login

martin_mueller
SplunkTrust
SplunkTrust

You could insert this:

... | fillnull value="n/a" Login1 Login2 | ...
0 Karma

andrey2007
Contributor

and it does not work for case like this user has only Login1 OR Login2
Number Name Position Login1 Login2

1 John expert johns2
2 Willy expert will1

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Huh? How does it work and throw an error message at the same time?

0 Karma

andrey2007
Contributor

Thanks, it works!
But with message like this
Field 'Login' does not exist in the data.

0 Karma

treinke
Builder

Maybe something like this?

<your search> | rename Login1 as Login | rename Login2 as Login | sort by Login | table Number,Name,Position,Login
There are no answer without questions
0 Karma

andrey2007
Contributor

sorry, but not
this way table looks like
Number Name Position Login2

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...