Splunk Search

How to use delimiter to filter data from a selected field in splunk??

gcd24967
Explorer

Hi  ,

I have my log entries line below:

2023-08-22T10:48:01.340641-07:00 ARC1 (PID:63766948): Archived Log entry 176651 added for T-1.S-31459 ID 0xffffffffadc86430
Labels (2)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

There are a couple of other ways you can do this to expand on @isoutamo reply, one (rex) with a different regex, where you don't always know the parts of the path and one (eval) where you always want the 4th element of the path

| rex field=source "(/[^/]*){3}/(?<db_name>[^/]+)"
| eval db_name=mvindex(split(source, "/"), 4)

 

View solution in original post

bowesmana
SplunkTrust
SplunkTrust

There are a couple of other ways you can do this to expand on @isoutamo reply, one (rex) with a different regex, where you don't always know the parts of the path and one (eval) where you always want the 4th element of the path

| rex field=source "(/[^/]*){3}/(?<db_name>[^/]+)"
| eval db_name=mvindex(split(source, "/"), 4)

 

gcd24967
Explorer

Thanks a lot for the help.

It worked as intended.

0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

you could try something like

....
| rex field=source "/rdbms/(?<db_name>[^/]+)" 

If I understand right you already have hostname in host field?

r. Ismo

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...