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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...