Splunk Search

Splitting a multivalue field on carreige return

jeffsegal
Explorer

good morning,
I am in the process of breaking out data from a data source that in one field contains a list of similar data for a single device (example below).

example:
(app | version\napp |version\n....)

I have been trying to use a split command using \n as the delimiter and that seems to be working, but when I try to expand the events, only a fraction of the events return. I have included a sample of the code i've been using for your review.

.....|eval new=split(_raw,"\n") |mvexpand new

This seems pretty straight forward, but it doesn't throw an error and it does bring back data, but a small fraction of the what the total should be.

Any suggestions would be greatly appreciated?

Tags (1)
0 Karma

somesoni2
Revered Legend

Try like this

....| eval new=_raw | eval new=split(new,"\\n") |mvexpand new

OR (if above doesn't work)

--- | eval new=replace(_raw,"[\r\n]+","##LBreak##") | makemv new delim="##LBreak##" | mvexpand new
0 Karma
Get Updates on the Splunk Community!

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...