All Apps and Add-ons

Exclusion of Delimiter in special condition

nina15
Communicator

I am using a search-time field extraction with transform being used.
the events only contain values -no field names- and they are all separated by commas which makes me able to use DELIMS and FIELDS in transform.conf.
My problem is though that for some special conditions I want splunk to skip the comma, like if there is a backslash after the comma, I want it to gather up all the previous and next characters as one field.

for example, if the event is:

AAA,BBB,CCC,/CCC,DDD

splunk will create:

field1 = AAA
field2 = BBB
field3 = CCC
field4 = /CCC
field5 = DDD

but I want the fields to be:

field1 = AAA
field2 = BBB
field3 = CCC,/CCC
field4 = DDD

how can I achieve that?

0 Karma

cbs01
Engager

While I don't have a play system available to try this, wouldn't you be able to define field3 something like:

(?\w{3}),(?\w{3}),(?\w{3}(,/\w{3}){0,1}),(?\w{3})

Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...