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!

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...