Dashboards & Visualizations

Recover fields after stats

marco_massari11
Communicator

Hi,

I have a first dashboard with this query:

index=ind  hostname=* (cat_name=success OR cat_name=failed) service=*
| eval site=substr(DeviceName,1,7) + substr(DeviceName, -4)
| stats values(cat_name) as status by mac service site
| where mvcount(status)=1 and status="failed" and service="x"
| dedup mac
| stats count by site

In the result I have a count of only "failed" by site. If I click on a count, I go to another dashboard that shows some informations for the specific site. This is the second dashboard query:


index=ind  hostname=* (cat_name=success OR cat_name=failed) service=*
| eval site=substr(DeviceName,1,7) + substr(DeviceName, -4)
| stats values(cat_name) as status by mac service site
| where mvcount(status)=1 and status="failed" and service="x"
| dedup mac
| search site="$token$"
| dedup mac  
| table site mac status ip dest

The problem is that I have not results for ip and dest, I think beacause I lost them after stats command. Can you help me???

 

Thanks in advance

Labels (5)
0 Karma
1 Solution

t_shreya
Path Finder

@marco_massari11 , can you try using eventstats instead of stats?

View solution in original post

t_shreya
Path Finder

@marco_massari11 , can you try using eventstats instead of stats?

marco_massari11
Communicator

@t_shreya  It works!!!

Thank you so much

0 Karma
Get Updates on the Splunk Community!

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...

Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

[Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...