Other Usage

report available devices per day

lemontree1
Explorer

I will get a report for the last 5 days with the avalability of devices/tools. Therefor I search for all defect Devices at a day with the stats dc command. Afterwards I will calculate the available devices with the equation

Avail = All - Defect

and displays this for every day in the last week. But after the stats dc command are only 2 fields visible:   _time , dc_Devices. For my calculation I need the All field too.

my search ...

| eval All = 100

| bin span=1d _time

| stats dc(Devices) as dc_Devices by _time

How to add a calculation for  the available value?

Thx in advance

Labels (1)
0 Karma
1 Solution

isoutamo
SplunkTrust
SplunkTrust

You must add All also to stats as after stats you have only those fields which are used in it. Based on values and meanings of All you could use e.g.

| stats values(All) as All dc(Devices) as dc_Devices by _time

Instead of values you could use list, max, min etc. based on your means. Other option is add All after "by _time" 

r. Ismo

View solution in original post

isoutamo
SplunkTrust
SplunkTrust

You must add All also to stats as after stats you have only those fields which are used in it. Based on values and meanings of All you could use e.g.

| stats values(All) as All dc(Devices) as dc_Devices by _time

Instead of values you could use list, max, min etc. based on your means. Other option is add All after "by _time" 

r. Ismo

Get Updates on the Splunk Community!

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco + Splunk! We’ve ...