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!

[Puzzles] Solve, Learn, Repeat: Unmerging HTML Tables

[Puzzles] Solve, Learn, Repeat: Unmerging HTML TablesFor a previous puzzle, I needed some sample data, and ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...

AI for AppInspect

We’re excited to announce two new updates to AppInspect designed to save you time and make the app approval ...