Splunk Search

Ignore milliseconds of _time when grouping

dukeatcoding
Engager

I need to ignore the milliseconds when I group by _time

stats avg(instance_internal) as amount by _time, unit_id, instance_id

Because of the milliseconds there are too much entires in the end.

How do I ignore the ms ?

Tags (1)
1 Solution

somesoni2
Revered Legend

Try this

your base search | bucket span=1s _time |stats avg(instance_internal) as amount by _time, unit_id, instance_id

OR

your base search | eval _time=strptime(strftime(_time,"%F %T"),"%F %T")|stats avg(instance_internal) as amount by _time, unit_id, instance_id

OR

your base search | eval _time=round(_time)|stats avg(instance_internal) as amount by _time, unit_id, instance_id

View solution in original post

somesoni2
Revered Legend

Try this

your base search | bucket span=1s _time |stats avg(instance_internal) as amount by _time, unit_id, instance_id

OR

your base search | eval _time=strptime(strftime(_time,"%F %T"),"%F %T")|stats avg(instance_internal) as amount by _time, unit_id, instance_id

OR

your base search | eval _time=round(_time)|stats avg(instance_internal) as amount by _time, unit_id, instance_id

dukeatcoding
Engager

great thanks 😉 span=1m works also perfect

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Reprocessing XML into Fixed-Length Events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...