Splunk Search

timechart with math function

hartfoml
Motivator

i am using timechart like this

search | timechart span=10m avg(diff)

but the diff number is in seconds I would like the answer in minutes like this

search | timechart span=10m avg(diff)/60

this doesn't work

Anyone have a suggestion??

Tags (2)
0 Karma
1 Solution

BenjaminWyatt
Communicator

Before creating your timechart, use an eval function to format your variable the way you would like. So try something like:

search | eval diff_in_min=(diff/60) | timechart span=10m avg(diff_in_min)

View solution in original post

oaustegard
Engager

A simpler way may be to use eval() (as function):
search | timechart span=10m eval(avg(diff)/60) as diff_in_min

BenjaminWyatt
Communicator

Before creating your timechart, use an eval function to format your variable the way you would like. So try something like:

search | eval diff_in_min=(diff/60) | timechart span=10m avg(diff_in_min)

hartfoml
Motivator

thanks much

0 Karma
Get Updates on the Splunk Community!

.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 ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...