Splunk Search

Help writing a condition for taking out average

splunkuseradmin
Path Finder

Hi all,
I need help in taking out “avg(“Participant”)” that is using calldevice1. 
 I need to write a condition here.
Explanation: In the below table, for every conference, we have multiple “participant” using some device. 
So we have a field name “calldevice1 duration” which is (0 or > 0)(in minutes) so need to write a statement or condition to take out an “avg(“Participant”)” by taking “voip duration” > 0 as 1 and “calldevice1 duration” = 0 as 0.

Thanks.

0 Karma
1 Solution

jnudell_2
Builder

Hi @splunkuseradmin ,
You can try the following search:


... [ your base search ] ...
| eventstats avg(eval(if('VoIP Duration' > 0, 1, 0))) as "Average" by ConferenceID

I'm not sure that's what you're trying to get, but that gives you the number you've specified in your question.

View solution in original post

0 Karma

jnudell_2
Builder

Hi @splunkuseradmin ,
You can try the following search:


... [ your base search ] ...
| eventstats avg(eval(if('VoIP Duration' > 0, 1, 0))) as "Average" by ConferenceID

I'm not sure that's what you're trying to get, but that gives you the number you've specified in your question.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...