Splunk Search

limit timechart with span and per_hour to 2 decimal values

rajnsoni92
Explorer

I have below query which shows values in line chart with up to 5 decimals and I want to limit it to max 2 decimals.

 

search text .. | eval reqs = 1 | timechart span=24h per_hour(reqs) as AvgReqPerHour

 

 

Labels (1)
Tags (2)
0 Karma

rajnsoni92
Explorer

Thank @etoombs It worked.

0 Karma

etoombs
Path Finder

Add this after your time chart:

| fieldformat AvgReqPerHour= round(AvgReqPerHour,2)

If you don't want the rounding, look at floor or max for the behaviors you want.

Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...