Splunk Search

Could someone help me with this regex?

Italy1358
Path Finder

Can someone help me pull out these data points:

cw.pptx;text.html;text.txt

I need it to split at the ; mark but have them in their own fields so I can only see the .txt in my search.

Labels (2)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @Italy1358,

the best approach is that you folow the guided ield extraction using the delimited fields option.

If instead you want to use a regex, you can try this:

| rex "^(?<field1>[^;]+);(?<field2>[^;]+);(?<field3>[^;]+)"

that you can test at https://regex101.com/r/9DI2ED/1

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @Italy1358,

the best approach is that you folow the guided ield extraction using the delimited fields option.

If instead you want to use a regex, you can try this:

| rex "^(?<field1>[^;]+);(?<field2>[^;]+);(?<field3>[^;]+)"

that you can test at https://regex101.com/r/9DI2ED/1

Ciao.

Giuseppe

Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...