Dashboards & Visualizations

eval calculation

sahana
Engager

I have a JSON object value as timetaken= 63542 in milliseconds, I  need to convert the stats max(timetaken) value which is in ms to seconds tried as like below  but it is not working out. 

search envId = *  message=PostLogin* | stats min(timetaken),max(timetaken), Avg(timetaken) | eval max_time=round((max(timetaken)/1000),2) , min_time = round((min(timetaken)/1000),2) | table max_time,min_time,Avg(timetaken)

 

But the above is producing the values in same ms even we convert it to seconds

 

 

0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

You should assign values in stats to the new name like this

search envId = * message=PostLogin* 
| stats min(timetaken) as minTimeTaken, max(timetaken) as maxTimeTaken,  Avg(timetaken) as avgTimeTaken
| eval max_time=round(maxTimeTaken/1000,2) , min_time = round(minTimeTaken/1000,2) 
| table max_time,min_time,avgTimeTaken

Otherwise there could be some confusion on eval.

r. Ismo 

0 Karma
Get Updates on the Splunk Community!

App Platform's 2025 Year in Review: A Year of Innovation, Growth, and Community

As we step into 2026, it’s the perfect moment to reflect on what an extraordinary year 2025 was for the Splunk ...

Operationalizing Entity Risk Score with Enterprise Security 8.3+

Overview Enterprise Security 8.3 introduces a powerful new feature called “Entity Risk Scoring” (ERS) for ...

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...