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!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...