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.

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!

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...