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

Get Updates on the Splunk Community!

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...