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!

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...