Splunk Cloud Platform

EVAL is not working as per expectation

ram_splunk
New Member

I am trying to run eval command to pull some stats but its erroring out as below 

Error in 'timechart' command: The eval expression has no fields: 'avg(properties.elapsed)'.

<search query>|timechart span=mon eval(round(avg(properties.elapsed),2)) as AverageResponsetime

where it was working perfectly fine in splunk enterprise system 

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

At the point that the round() function is evaluated, the avg() has not been calculated by the timechart command. You will need to do your rounding in a separate command after the timechart command.

0 Karma

ram_splunk
New Member

hi @ITWhisperer 

 

i have removed round command and executed as below but still i am getting error 

 

timechart span=mon eval(avg(properties.elapsed)) as AverageResponsetime

 

could you please share me the correct one to resolve issue 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| timechart span=mon avg(properties.elapsed) as AverageResponsetime
| eval AverageResponseTime=round(AverageResponseTime,2)
0 Karma

ram_splunk
New Member

Thanks @ITWhisperer it worked 

0 Karma
Get Updates on the Splunk Community!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...