Splunk Search

Average alarms per reader over time

msage
Path Finder

A bit ago I submitted a question regarding how to get the average alarms per reader. So for example we have 100 alarms and 100 readers. That's on average 1 alarm per reader. With the help of the forum I got my answer but now I need to figure out how to get a trend of this search. I tried using a timechart but based on the way the search is built, it completely skews the results. Here's the search itself 

 

index="index" EVDESCR="EVDESCR"
| dedup EVENT_TIME
| bucket _time span=1d
| stats count by READERDESC
| stats sum(count) as sum_count
| eval result=sum_count / 220

 

Labels (3)
0 Karma
1 Solution

yuanliu
SplunkTrust
SplunkTrust

@msage You want to illustrate what timechart command you have tried and what is the difference between actual result and expected results so others can understand the intended use case.   The second stats  command in the search you illustrated negates the groupby in the first, and the time bucket  has  no effect.  The entire search can be collapsed as

 

index="index" EVDESCR="EVDESCR"
| dedup EVENT_TIME
| stats count as sum_count
| eval result=sum_count / 220

 

If I speculate your intentions based on the subject line and the illustrated search, you have  220 readers (not 100); you want a single average value, nothing grouped by READER_DESC.  This might be what you are asking for

 

index="index" EVDESCR="EVDESCR"
| dedup EVENT_TIME

| timechart span=1d count as average_alarms_per_reader
| eval average_alarms_per_reader = average_alarms_per_reader / 220

 

  Basically, count how many total alarms per day, and divide each count by  220.

View solution in original post

yuanliu
SplunkTrust
SplunkTrust

@msage You want to illustrate what timechart command you have tried and what is the difference between actual result and expected results so others can understand the intended use case.   The second stats  command in the search you illustrated negates the groupby in the first, and the time bucket  has  no effect.  The entire search can be collapsed as

 

index="index" EVDESCR="EVDESCR"
| dedup EVENT_TIME
| stats count as sum_count
| eval result=sum_count / 220

 

If I speculate your intentions based on the subject line and the illustrated search, you have  220 readers (not 100); you want a single average value, nothing grouped by READER_DESC.  This might be what you are asking for

 

index="index" EVDESCR="EVDESCR"
| dedup EVENT_TIME

| timechart span=1d count as average_alarms_per_reader
| eval average_alarms_per_reader = average_alarms_per_reader / 220

 

  Basically, count how many total alarms per day, and divide each count by  220.

msage
Path Finder

Hey @yuanliu basically what it was doing was getting the average of all the days by 220 rather than average of each day. However the search string you just provided seems to be the perfect solution for this.

0 Karma
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...