My data
Send_Data | Error | All_Request |
2018-01-02 | 0 | 10 |
2018-01-03 | 1 | 60 |
2018-01-04 | 2 | 30 |
2018-01-05 | 0 | 20 |
.... | ... | ... |
2021-02-01 | 5 | 20 |
I want to make chart from those data.
The x-axis is the number of weeks passed.The y-axis is the error rate during this week
This is the effect i want
The data used in the first week is 2018-01-03->2018-01-09.The y-axis is made using all Error/All_Request in this time period.
The data used in the second week is 2018-01-10->2018-01-16 and so on.
I have used many methods, but they can’t be achieved.
The timechart command span option supports binning by week (Sunday through Saturday):
index=_internal
| timechart span=1w@w count(eval(case(log_level=="ERROR",1))) as Error count as All_Request
_time | Error | All_Request |
2020-12-27 | 1 | 123 |
2021-01-03 | 2 | 456 |
2021-01-10 | 3 | 789 |
2021-01-17 | 2 | 123 |
2021-01-24 | 1 | 456 |
2021-01-31 | 2 | 789 |
2021-02-07 | 3 | 123 |
2021-02-14 | 4 | 456 |
2021-02-21 | 2 | 789 |