Splunk Search

How to write the regex and configure transforms.conf to extract multiple values for one field?

jlhamlet
Path Finder

Hi,

I am indexing data with events in this format:

Field1:value1|Field1:value2 .....

In my transforms.conf i set the regex to :

REGEX =  (?<_KEY_1>[a-zA-Z]+):(?<_VAL_1>[^|]+)

This only extracts Value1 for Field1 and seems to ignore Value2.

I am a newbie to regex, can someone help me out here ?

Note that the IFX (web interface) does not allow me to extract Value2 to Field1.

Thank you,

0 Karma
1 Solution

Ayn
Legend

Add "MV_ADD = true" in your transforms.conf. By default Splunk will write results only if the field it's about to write to is empty. When you set MV_ADD to true, Splunk will instead add the new value to the existing field, and make it multivalued.

View solution in original post

Ayn
Legend

Add "MV_ADD = true" in your transforms.conf. By default Splunk will write results only if the field it's about to write to is empty. When you set MV_ADD to true, Splunk will instead add the new value to the existing field, and make it multivalued.

jlhamlet
Path Finder

Thank You very much for your help. It worked perfectly.

Regards,

jlhamlet
Path Finder

Thank you, I will test this and get back to you.

0 Karma
Get Updates on the Splunk Community!

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

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 ...