Wonder if anyone has tried to write something to export large quantity of logs from Loki. I realize you can download logs from Grafana Explorer, but it’s limited and certainly won’t work if you want to export logs spanning days.
What I am currently attempting to do is write a python script that sends API calls to /query_range
endpoint on a set time frame (for example, divide 24 hours into 48 30-minute blocks / queries). Problems I’ve run into:
-
It returns with 413 if
limit
is set too high (anything above 30,000) on the API string. In Loki logs we simply seecontext canceled
. We configuremax_entries_limit_per_query
to be1000000
, but doesn’t seem to be honored here. -
Somewhat related to #1. Because Loki api doesn’t have paging, it’s hard to gauge exactly how refined the time window needs to be. Combined with the fact we can’t get API to run with any sort of reasonably large limit, it really looks like it’ll be a very inefficient process.
Any input would be appreciated.