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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...