Splunk Enterprise

MUltivalue fields

bhavneeshvohra
Engager

i have a field as abc=1\,2\,3\,4\,5\,

i need to reemove the backslashes and  have a multivalue field like abc=1,2,3,4,5

How to do this please help.

Labels (1)
Tags (1)
0 Karma

manjunathmeti
Champion

hi @bhavneeshvohra,

Use replace function with eval command OR rex command with sed.

 

| eval abc=replace(abc, "\\\\", "")

 

OR

 

| rex field=abc mode=sed "s/\\\//g"

 

Then if you want to make field abc a multivalued field using makemv:

| eval abc=replace(abc, "\\\\", "") | makemv delim="," abc

Field abc is further expanded using mvexpand,

| eval abc=replace(abc, "\\\\", "") | makemv delim="," abc | mvexpand abc

 

If this reply helps you, an upvote/like would be appreciated.

0 Karma
Get Updates on the Splunk Community!

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to Officially Supported Splunk ...