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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...