Splunk Search

Grouping similar results (URL)

ashwinkhai
Engager

I am trying to pull list of different URLs from a splunk query. The data is like below.

Sample data:
1. Need to group data like below as one - /v7/ap/deal/config?groupid
/v7/ap/deal/config?groupId=1234
/v7/ap/deal/config?groupId=4567
/v7/ap/deal/config?groupId=8910

  1. Need to group data like below as one - /v7/ap/deals/*/deals-allowed
    /v7/ap/deals/1234567/deals-allowed
    /v7/ap/deals/N32343Ds/deals-allowed
    /v7/ap/deals/F3e43Ds/deals-allowed

  2. Need to group datalike below as one -- /v1/deal/deals//deal-group/item?startdate

/v1/deal/deals/1234567/deal-group/item?startdate=2020-01-21
/v1/deal/deals/N1234/deal-group/item?startdate=2019-01-21
/v1/deal/deals/E2345/deal-group/item?startdate=2019-10-21
/v1/deal/deals/F2354/deal-group/item?startdate=2019-12-21

Tags (2)
0 Karma
1 Solution

codebuilder
Influencer

Use the "cluster" function. It is extremely useful and will do exactly what you're asking.

Example usage:

index=_internal source=*splunkd.log* log_level!=info | cluster showcount=t | table cluster_count _raw | sort -cluster_count

alt text

----
An upvote would be appreciated and Accept Solution if it helps!

View solution in original post

ashwinkhai
Engager

Thanks alot for the information. Is it possible to use cluster command on one field. In my case it is url field alone.

0 Karma

codebuilder
Influencer

Glad to help. And yes, you can use this with any query, just pipe the results to cluster, and/or table any fields you want to display.

----
An upvote would be appreciated and Accept Solution if it helps!
0 Karma

codebuilder
Influencer

Use the "cluster" function. It is extremely useful and will do exactly what you're asking.

Example usage:

index=_internal source=*splunkd.log* log_level!=info | cluster showcount=t | table cluster_count _raw | sort -cluster_count

alt text

----
An upvote would be appreciated and Accept Solution if it helps!
Get Updates on the Splunk Community!

Say goodbye to manually analyzing phishing and malware threats with Splunk Attack ...

In today’s evolving threat landscape, we understand you’re constantly bombarded with phishing and malware ...

AppDynamics is now part of Splunk Ideas

Hello Splunkers, We have exciting news for you! AppDynamics has been added to the Splunk Ideas Portal. Which ...

Advanced Splunk Data Management Strategies

Join us on Wednesday, May 14, 2025, at 11 AM PDT / 2 PM EDT for an exclusive Tech Talk that delves into ...