Splunk Search

Extracting data in between unique characters

behymejt2012
Path Finder

Hi Everyone,

I am still new to Splunk and have found myself in a predicament for extracting a specific value, within a value. So for the following:

usb#android(04e8) mass storage(685e)#abc123abc123

I am trying to extract everything between # and # so essentially "android(04e8) mass storage(685e)". I have head about using regex/rex but I wasn't sure if there was an eval function that could perform this?

Tags (2)
0 Karma
1 Solution

Ayn
Legend

Why not use regex? 🙂

rex "#(?<yourfieldname>.+?)#"

View solution in original post

Ayn
Legend

Why not use regex? 🙂

rex "#(?<yourfieldname>.+?)#"

behymejt2012
Path Finder

Perfect. Was also looking at I would pull all the content from the beginning to a specific character ")". Ex from above: "android"

Also, any recommended avenues for learning this version of regex (books, articles, etc)

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...