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!

Detector Best Practices: Static Thresholds

Introduction In observability monitoring, static thresholds are used to monitor fixed, known values within ...

Expert Tips from Splunk Education, Observability in Action, Plus More New Articles on ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Changes to Splunk Instructor-Led Training Completion Criteria

We’re excited to share an update to our instructor-led training program that enhances the learning experience ...