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!

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...