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 Observability for AI

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

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

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...