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 Enterprise Security(ES) 7.3 is approaching the end of support. Get ready for ...

Hi friends!    At Splunk, your product success is our top priority. With Enterprise Security (ES), we're here ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability for AI

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