All Apps and Add-ons

How do I split a column by comma and convert the result into multiple rows?

Liuzhengchen
Explorer

Hi guys,

How do I split column by comma and convert the result into multiple rows?

eg.
host ips
A 1.1.1.1,1.1.1.2
B 2.2.2.2,2.2.2.3

need to convert to

host ips
A 1.1.1.1
A 1.1.1.2
B 2.2.2.2
B 2.2.2.3

Tags (1)
0 Karma
1 Solution

renjith_nair
Legend

@Liuzhengchen,

Try,

"your current search to get host,ips" |makemv ips delim=","|mvexpand ips

References :
https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Makemv
https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Mvexpand

---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

0 Karma

renjith_nair
Legend

@Liuzhengchen,

Try,

"your current search to get host,ips" |makemv ips delim=","|mvexpand ips

References :
https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Makemv
https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Mvexpand

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

Liuzhengchen
Explorer

It works for me. Thank you so much renjith.

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...