Archive

How to search for average data indexed over 30, 60, 90 days by index?

Path Finder

Splunkers,

Looking for a search string that will allow me to use the time picker to see how much data has been indexed over 30, 60, 90, etc days by index. I tried a few searches but had no luck.

Any help would be greatly appreciated.

Thanks

0 Karma
1 Solution

Path Finder

So this is an example over three days, but this should vaguely work for your purposes. I've only focused on one index for demonstrative purposes.

Change hours to months (-3mon@mon and @mon) or 30 days (-90d@d, @d, bin _time span=30d) for this to work

index=_internal source=*license_usage.log* idx=my_index earliest=-3h@h latest=@h
| bin _time span=1h
| stats sum(b) as bytes by idx, _time
| reverse
| streamstats sum(bytes) as total_bytes by idx
| timechart values(total_bytes) by idx span=1h

Hope this helps!

Edit: Used accum instead of streamstats -- this should work now.

View solution in original post

0 Karma

Path Finder

So this is an example over three days, but this should vaguely work for your purposes. I've only focused on one index for demonstrative purposes.

Change hours to months (-3mon@mon and @mon) or 30 days (-90d@d, @d, bin _time span=30d) for this to work

index=_internal source=*license_usage.log* idx=my_index earliest=-3h@h latest=@h
| bin _time span=1h
| stats sum(b) as bytes by idx, _time
| reverse
| streamstats sum(bytes) as total_bytes by idx
| timechart values(total_bytes) by idx span=1h

Hope this helps!

Edit: Used accum instead of streamstats -- this should work now.

View solution in original post

0 Karma

Path Finder

index=internal source=*licenseusage.log* idx=* | bin _time span=1d | stats sum(b) as bytes by idx, _time | stats avg(bytes) as bytes by idx | eval GB = round(bytes/1024/1024/1024, 4) | eval MB = round(bytes/1024/1024, 4) | table idx, GB, MB | rename idx as Index, GB as "Average GB Indexed per Day", MB as "Average MB Indexed per Day"

This ended up being my solution.

0 Karma

SplunkTrust
SplunkTrust

Can you share what you've tried?

0 Karma