Getting Data In

Split MV into new table rows

ereed18
Engager

I have rows where data looks like..

  1. Value1^Value2^Value3
  2. Value4^Value5
  3. Value6
  4. Value7^Value8

My query (below)...

search here
| eval temp=split(FieldA,"^")
| table temp

Makes the following..
1.Value1
Value2
Value3
2.Value4
Value5
3.....

I need each value to be on a separate row. Additionally, I need the count of each time the row is returned in the event. Currently when I add "| stats count by FieldA as hits" no data is returned.

Please help!

Tags (2)
0 Karma
1 Solution

somesoni2
Revered Legend

To see every field value in separate row

search here | eval temp=split(FieldA,"^") | table temp | mvexpand temp

To get the count

search here | eval temp=split(FieldA,"^") | table temp | stats count as hits by temp

View solution in original post

somesoni2
Revered Legend

To see every field value in separate row

search here | eval temp=split(FieldA,"^") | table temp | mvexpand temp

To get the count

search here | eval temp=split(FieldA,"^") | table temp | stats count as hits by temp

ereed18
Engager

I had to move "mvexpand" in front of "table", but that works. Additionally, count had to go to the end when I was trying to count, table the field and count then expand the rows. I think my order might have caused my issues. Thanks!

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 ...