Splunk Search

Timechart, last value is always 0

dbcase
Motivator

Hi,

I have this query

index=os sourcetype=vmstat OR sourcetype=cpu OR sourcetype=df  host=betamax-admin   Filesystem="/dev/mapper/vg_betamaxadmin-lv_root" | timechart  span=5m max(PercentUsedSpace)

All it does it gets the % of diskspace used for a given host. Yet when I run it, the most recent value is always 0, which is odd. (see attached pic)

I wait a few minutes and try it again and the time changes but still the value is 0

alt text

1 Solution

somesoni2
Revered Legend

It could be due to the last bin is partial and doesn't contain data, but based on your time range and when you executed the query, it got included in the result. The best option would to be use timechart option partial=false to remove any (generally first and last bin only) partial bins. See this for more info.
http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/timechart#Optional_arguments

index=os sourcetype=vmstat OR sourcetype=cpu OR sourcetype=df  host=betamax-admin   Filesystem="/dev/mapper/vg_betamaxadmin-lv_root" | timechart  partial=f span=5m max(PercentUsedSpace)

View solution in original post

somesoni2
Revered Legend

It could be due to the last bin is partial and doesn't contain data, but based on your time range and when you executed the query, it got included in the result. The best option would to be use timechart option partial=false to remove any (generally first and last bin only) partial bins. See this for more info.
http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/timechart#Optional_arguments

index=os sourcetype=vmstat OR sourcetype=cpu OR sourcetype=df  host=betamax-admin   Filesystem="/dev/mapper/vg_betamaxadmin-lv_root" | timechart  partial=f span=5m max(PercentUsedSpace)

dbcase
Motivator

Thanks Somesoni2! That worked like a charm! Learn something new every day to boot!

0 Karma
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 ...