Splunk Search

Get unique values from with in a field.

sanchitlohia
Explorer

I have a splunk entry like this

url="11111/toy/{toy_id}/part/{part_id}"

Here toy_id and part_id are six digit numbers.

How do I write my splunk query so that I get results only with unique toy_id.

Thanks for your help.

Tags (1)
0 Karma

somesoni2
SplunkTrust
SplunkTrust

By "Only with unique toy_id", do you mean get one results per toy_id (so all events have unique toy_id) or get result with toy_id which have appeared only once?

0 Karma

wpreston
Motivator

If toy_id is already extracted, you could use this:

... your base search ... | dedup toy_id | ... rest of your search ...

If toy_id is not extracted as a field, you could use this:

... your base search ... | rex "url="\d+\/.+?\/{(?<toy_id>[^}]+)" | dedup toy_id | ... rest of your search ...
0 Karma
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 ...