Hey guys!
I need the statistics of a bunch of data by month. And this is done already.
search
|eval Month=strftime(_time,"%Y %m") | stats count(mydata) AS nobs, mean(mydata) as mean, min(mydata) as min by Month | reverse
The output is what I want:
Month | nobs | mean | min |
2023 06 | 1900 | -5.0239778 | -68.73417 |
2023 05 | 3562 | -4.2430259 | -67.134697 |
2023 04 | 3181 | -4.1811658 | -64.995394 |
2023 03 | 4274 | -4.3373071 | -134.20177 |
2023 02 | 3939 | -4.7725011 | -73.538274 |
2023 01 | 2868 | -5.5231115 | -41.056093 |
2022 12 | 395 | -4.617424 | -35.51642 |
Now I need add another row on the very top with statistics for the most recent WEEK. Ideally, I can use the search result without the need to search again and degrade performance. Thanks!
Maybe last week is the wrong way to specify it. I should have written "the previous 7 days". Thanks!