Dashboards & Visualizations

I want to get string between two hypeen and show in table

bhimjian
Engager

I want to get string between two hypeen and show in table as input as :  some text - 512ad85e-e968-45cc-8783-30b696217j5a -  some text , and result must be 512ad85e-e968-45cc-8783-30b696217j5a  . there may be more no of records i just want to filter all distinct records.

what i tried is using regex  \\w{8}-?\\w{4}-?\\w{4}-?\\w{4}-?\\w{12}.

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Assuming the delimiting hyphens are surrounded by spaces

| rex "\s-\s(?<id>.+)\s\-\s"

If you want a specific format of id as you have shown in you example, replace the .+ with your format.

View solution in original post

bhimjian
Engager

@ITWhisperer  Thank you.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Assuming the delimiting hyphens are surrounded by spaces

| rex "\s-\s(?<id>.+)\s\-\s"

If you want a specific format of id as you have shown in you example, replace the .+ with your format.

Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI! Discover how Splunk’s agentic AI ...

[Puzzles] Solve, Learn, Repeat: Dereferencing XML to Fixed-length events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Stay Connected: Your Guide to December Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...