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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2026-2027 SplunkTrust is officially open. If ...