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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...