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!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...