Splunk Search

Can anyone provide me a simple example for using REGEX with DELIMS?

zcwang
New Member

Could anyone provide me a simple example for using REGEX with DELIMS? The event in my scenario is full of delimiter-separated field/value pairs, so I used two sets of quoted delimiters. However, the first set of delimiters might be either "," or " ". So I wonder if I could use an OR for the first delimiter. Thanks!

Tags (2)
0 Karma

Richfez
SplunkTrust
SplunkTrust

zcwang,

An example of the item in question would make this easier, but I'll try:

Any of the delimiter characters you specify will be considered a delimiter. The docs for transforms.conf provides an example of this

[multiple_delims]
DELIMS = "|;", "=:"

Which they describe as The above example extracts key-value pairs which are separated by '|' or ';', while the key is delimited from value by '=' or ':'.

So that would use either | or ; for the field separators and either one of = or : as the field=value separator. This would match log lines like

|field1=val1;field2=val2|field3:val3;field4=val4;

and pull out of them

field1=val1
field2=val2
field3=val3
field4=val4
0 Karma

MuS
SplunkTrust
SplunkTrust

providing some sample events will be useful in this case.....

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...