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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...