Splunk Search

How to one index two different device count calclation

Richard_400
Engager

I want chart as follow.

I could show count each count value (cannot Calc field)

(index=interface_count devicename IN ($select_device$) INTinfo1=Gi0/1 OR Gi0/2 data_field_name=Rx_counter) OR (index=interface_count devicename IN ($select_device2$) description IN ($select_device$) data_field_name=Rx_counter)
timechart span=5m eval(round(max(eval(Rx/1E5)),1)) as Rx_count by INTinfo1
_time Device_A Gi0/1 (a) Device_A Gi0/2 (b) Device_B Gi0/8 (c) Calc A+B-C
10:00 100 200 50 250
10:05 100 300 80 320
10:10 150 250 100 300

 

 

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Richard_400,

you have to use a function (e.g. count or sum or avg) begore of the eval in the stats command:

 

(index=interface_count devicename IN ($select_device$) INTinfo1=Gi0/1 OR Gi0/2 data_field_name=Rx_counter) OR (index=interface_count devicename IN ($select_device2$) description IN ($select_device$) data_field_name=Rx_counter)
| timechart span=5m max(Rx/1E5) as Rx_count by INTinfo1

 

Ciao.

Giuseppe

0 Karma

Richard_400
Engager

how can I type it?

I tried sum function but it results value A+B+C. 

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

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