Splunk Search

How to List records where a field contains a specific string?

nlxtasy69
Engager

I have an index: an_index , there's a field with URLs - URL/folder/folder   I only want to list the records that contain a specific URL.  I don't care about anything after the URL.  I just want to match the URL

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| regex Field_x="^https:\/\/xyz\.com\/"

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

Strictly speaking, URLs can include folders. What do you mean by URL?

0 Karma

nlxtasy69
Engager

For example:

Field_x = https://xyz.com/folder_a/folder_b

Field_x = https://abc.com/folder_x

 

I want to only list the records where Field_x contains https://xyz.com

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @nlxtasy69,

did you tried something like this?

index=an_index
| rex "^(?<URL>https:\/\/xyz\.com"
| stats count BY URL

Ciao.

Giuseppe

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| regex Field_x="^https:\/\/xyz\.com\/"
Get Updates on the Splunk Community!

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...