Dashboards & Visualizations

mutliple moving averages for a time chart.

learningsplunk
Path Finder

Hello Splunk community, 

For this dataset : 

TimeAgentNumber of calls taken
11:00 AMJohn1
11:00 AMKate0
11:00 AMEric1
10:00 AMJohn2
10:00 AMKate1
10:00 AMEric0
9:00 AMJohn0
9:00 AMKate1
9:00 AMEric1
8:00 AMJohn3
8:00 AMKate1
8:00 AMEric2
7:00 AMJohn3
7:00 AMKate5
7:00 AMEric2
6:00 AMJohn2
6:00 AMKate3
6:00 AMEric0


Is it possible to get a moving average for each agent along with the moving average for the total amount of calls in one specific hour  and to place this all into a time chart? 

this is the Splunk query I'm currently using :

| union [| search  <insert index here>  AGENT=* | bin _time span=1h | stats count BY _time | trendline wma2(count) AS AverageNumberoftotalcallsperhour |table _time AverageNumberoftotalcallsperhour ]
[| search <insert index here> Agent=Kate| bin _time span=1h | stats count BY _time | trendline wma2count) AS AvgKate |table _time AvgKate ]
[| search<insert index here>  Agent=John| bin _time span=1h | stats count BY _time | trendline wma2(count) AS AverageNumberOfCallsPerHourbyJohn |table _time AverageNumberOfCallsPerHourbyJohn  ]
[| search<insert index here> Agent=Eric| bin _time span=1h | stats count BY _time | trendline wma2(count) AS AvgEric |table _time AvgEric ]



However, when trying to run the splunk query,  the output isn't correct : 

_timeAverageNumberoftotalcallsperhourAvgKateAverageNumberOfCallsPerHourbyJohnAvgEric  
6:00 AM2     
7:00 PM2     
8:00 AM 3    
9:00 AM 3    
10:00 AM  4   
11:00 AM  4   

Noon

   5  

               

Labels (1)
Tags (2)
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Catalog Is Now Generally Available on Splunk Cloud Platform

A Unified View of Your Data  Security logs, application events, business data, and historical telemetry often ...

Developer Spotlight with Eduard Lekanne

From Network Engineer to Building Agentic AI for Splunk Eduard Lekanne has been architecting technology ...

From Data Landing to Insight

Search Across More of Your Data Ecosystem The data you need may live in Splunk, high-volume machine data, ...