Installation

Help with previous weeks index totals by day Report

plarsenDST
Explorer

I have this report for license usage for one day emailed to me daily, that shows totals by index and a daily total.

I want a report with this same format repeated/listed 5 times showing the previous weeks days Mon-Friday and I'm not sure how to accomplish it.

A manager report so they can see daily totals for the previous week emailed out on Monday AM. The email and schedule part is not the issue for me. Just the SPL learning curve.

index=_internal earliest=-1d@d latest=-0d@d source=*license_usage.log* type=Usage | bucket span=1d _time | stats sum(b) as bytes by _time idx | eval gb=round(bytes/1024/1024/1024,3) | addtotals row=false col=true | rename idx as Index | rename gb as "Total GB"
Labels (2)
0 Karma
1 Solution

somesoni2
Revered Legend

Give this a try

 index=_internal earliest=-1w@w1 latest=-1w@w5 source=*license_usage.log* type=Usage | bucket span=1d _time | stats sum(b) as bytes by _time idx | eval gb=round(bytes/1024/1024/1024,3) | appendpipe [| stats sum(gb) as gb by _time | eval idx="ZZZZZ"] | sort _time idx | rename idx as Index | rename gb as "Total GB" | eval Index=if(Index="ZZZZZ","Total For Day",Index)

View solution in original post

0 Karma

plarsenDST
Explorer

I think this will work.. I had to change latest=-1w@w5
to -0 for it to run correctly. - Thanks for the help.

 index=_internal earliest=-1w@w1 latest=-0w@w5 source=*license_usage.log* type=Usage | bucket span=1d _time | stats sum(b) as bytes by _time idx | eval gb=round(bytes/1024/1024/1024,3) | appendpipe [| stats sum(gb) as gb by _time | eval idx="ZZZZZ"] | sort _time idx | rename idx as Index | rename gb as "Total GB" | eval Index=if(Index="ZZZZZ","Total For Day",Index)
0 Karma

somesoni2
Revered Legend

Give this a try

 index=_internal earliest=-1w@w1 latest=-1w@w5 source=*license_usage.log* type=Usage | bucket span=1d _time | stats sum(b) as bytes by _time idx | eval gb=round(bytes/1024/1024/1024,3) | appendpipe [| stats sum(gb) as gb by _time | eval idx="ZZZZZ"] | sort _time idx | rename idx as Index | rename gb as "Total GB" | eval Index=if(Index="ZZZZZ","Total For Day",Index)
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...