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!

Part 2: A Guide to Maximizing Splunk IT Service Intelligence

Welcome to the second segment of our guide. In Part 1, we covered the essentials of getting started with ITSI ...

Part 1: A Guide to Maximizing Splunk IT Service Intelligence

As modern IT environments continue to grow in complexity and speed, the ability to efficiently manage and ...

Exporting Splunk Apps

Join us on Monday, October 21 at 11 am PT | 2 pm ET!With the app export functionality, app developers and ...