Splunk Search

How to get Daily average value of a field

jenkinsta
Path Finder

I have voltage data and want to get the average volts value per day for the last 7 days. 

This is where I left off from using bin to multiple timecharts and still nothing. 

source="/root/Scripts/VoltageLogger/Voltage.json" host="util" sourcetype="_json"
| timechart span=1d count by avg(voltage)

 

 

Labels (2)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

This should work - you are not counting, but calculating average, so use avg(voltage) like this

source="/root/Scripts/VoltageLogger/Voltage.json" host="util" sourcetype="_json"
| timechart span=1d avg(voltage) as avg_voltage

 

View solution in original post

0 Karma

bowesmana
SplunkTrust
SplunkTrust

This should work - you are not counting, but calculating average, so use avg(voltage) like this

source="/root/Scripts/VoltageLogger/Voltage.json" host="util" sourcetype="_json"
| timechart span=1d avg(voltage) as avg_voltage

 

0 Karma

jenkinsta
Path Finder

THanks, was close but long day and brain stopped working. 

0 Karma
Get Updates on the Splunk Community!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...