Getting Data In

How do I individual count each of them in this path?

thiruyadav17
Engager


So, I wanted to Split the path into multiple events so that i can count whatever i want to count like active or dev or usa or etc.

We have few path i.e below

path=/dev/site/usa/active

path=/prod/site/usa/inactive

path=/dev/site/Germany/cleaning

path=/qa/site/Austria/maintenancemode

 

So now i want to count each of active by usa, dev
then I want to get the top 5 counts of it.

In the results i want to see the bar graph like
active 
cleaning 

maintenancemode

instead of whole path. 

Note: I don't have backend access. 

Labels (1)
Tags (3)
0 Karma

somesoni2
Revered Legend

 

 

Assuming the format of "path" including location of segments is static, you can extract each segment as separate field, like this

 

your current search which fetch field path
| rex field=path "\/(?<env>[^\/]+)\/site\/(?<country>[^\/]+)\/(?<status>[^\/]+)"

 

 

And then run your aggregation per your requirement

your current search which fetch field path
| rex field=path "\/(?<env>[^\/]+)\/site\/(?<country>[^\/]+)\/(?<status>[^\/]+)"
| stats count by env country status
| where country="usa" AND env="dev" AND status="active"
| sort 5 -count

ITWhisperer
SplunkTrust
SplunkTrust
| eval part=split(path,"/")
| stats count by part
Get Updates on the Splunk Community!

New This Month in Splunk Observability Cloud - Metrics Usage Analytics, Enhanced K8s ...

The latest enhancements across the Splunk Observability portfolio deliver greater flexibility, better data and ...

Alerting Best Practices: How to Create Good Detectors

At their best, detectors and the alerts they trigger notify teams when applications aren’t performing as ...

Discover Powerful New Features in Splunk Cloud Platform: Enhanced Analytics, ...

Hey Splunky people! We are excited to share the latest updates in Splunk Cloud Platform 9.3.2408. In this ...