Splunk Search

makemv not working

brinley
Path Finder

I have the following single-value field (that really should be a multi-value field):

puppy_name="Spot Dexter Jake"

It really should be a multivalue field, like ...

puppy_name="Spot" "Dexter" "Jack"

Here is what I have tried:

index=puppies | makemv puppy_name delim=" "

Unfortunately that is not working. I can tell because when when I expand an event with the field puppy_name and hover over puppy_name's value in the dropdown, "Spot Dexter Jack" is still a single unit. What am I doing wrong?

0 Karma
1 Solution

brinley
Path Finder

I figured it out. I was using the wrong delim. The delim between each puppy name appeared to be a space in the search results but it was really a newline. Passing delim="\n" to makemv didn't work, so I just converted the newlines into a bar, "|", and then used the bar as the delim.

Final query:

index="puppies" | eval new_puppy_name=puppy_name | rex mode=sed field="new_puppy_name" "s/\n/|/g"| makemv new_puppy_name delim="|"

View solution in original post

0 Karma

brinley
Path Finder

I figured it out. I was using the wrong delim. The delim between each puppy name appeared to be a space in the search results but it was really a newline. Passing delim="\n" to makemv didn't work, so I just converted the newlines into a bar, "|", and then used the bar as the delim.

Final query:

index="puppies" | eval new_puppy_name=puppy_name | rex mode=sed field="new_puppy_name" "s/\n/|/g"| makemv new_puppy_name delim="|"
0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...