Splunk Search

How to use stats list() but separate each value with ";"?

phamxuantung
Communicator

Hello,

I'm using stats list() to merge all my value into one field, but I want them to seperate with each other by ";" instead of space.

Example

USER_PHONE
123
456
789

 

When I use |stats list(USER_PHONE) the result I receive( in the csv that I output) was

123 456 789

The result that I want is 123;456;789

I try to use

... | rex mode=sed field=USER_PHONE "s/ /;/g"

But it have no effect, what should I do?

Labels (3)
0 Karma
1 Solution

Manasa_401
Communicator

Hello @phamxuantung 

you can also achieve it using mvjoin command.

|stats list(USER_PHONE) as phone
|eval phone=mvjoin(phone,";")

If this helps, karma would be appreciated.

Thanks,

Manasa

View solution in original post

Manasa_401
Communicator

Hello @phamxuantung 

you can also achieve it using mvjoin command.

|stats list(USER_PHONE) as phone
|eval phone=mvjoin(phone,";")

If this helps, karma would be appreciated.

Thanks,

Manasa

Get Updates on the Splunk Community!

What’s New in Splunk Observability Cloud – June 2025

What’s New in Splunk Observability Cloud – June 2025 We are excited to announce the latest enhancements to ...

Almost Too Eventful Assurance: Part 2

Work While You SleepBefore you can rely on any autonomous remediation measures, you need to close the loop ...

Leveraging Detections from the Splunk Threat Research Team & Cisco Talos

 Stay ahead of today’s evolving threats with the combined power of the Splunk Threat Research Team (STRT) and ...