Splunk Search

transpose xyseries not helping

mukulraghuram
New Member

Need to transform like this. Please help.

Before:

  Col1----Col2
Name1----   a
    ------------b
--------c

After:`

Col1    Col2    Col3    Col4
Name1   a   b   c
Tags (2)
0 Karma

to4kawa
Ultra Champion
| makeresults 
| eval _raw="col1 col2
Name1 a
      b
      c" 
| multikv forceheader=1
| table col1 col2
| eval tmp=mvappend(col1,col2)
| stats list(tmp) as tmp
| mvexpand tmp
| streamstats count
| eval cols="col".count
| xyseries count cols tmp
| eval count=1
| stats values(*) as * by count
| fields - count

It's not easy.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...