historical_requests url format
Description
Downloaded latest version and ran the historical_requests command
canvasDataCli historical-requests -c config.js
Date ranges were not part of the output.
In https://github.com/instructure/canvas-data-cli/blob/master/src/HistoricalRequests.js
getRangeForFile parses the url with url.split('/')[7]. However, when I look at our URLs, they are not in that format. They are:
https://bucket.amazonaws.com/ACCOUNT/requests/RANGE/etc/etc
Therefore the code should be url.split('/')[5]
I made this change in my local copy and it resolved the issue.
Additional Information
- Node Version v18.2.0
- Platform: Alpline 3.16.0
- Logs: (If you can please run the CLI with:
-l debugand provide us the debug logs.)
FWIW, I built this with a Docker container
Dockerfile contents
FROM alpine:latest
RUN apk add nodejs npm RUN apk add nodejs-current
RUN npm install -g canvas-data-cli
====
docker build -t canvasdata . docker run -it --rm --name canvasdata canvasdata
The urls in my original note lost the code elements
New format is:
"https://BUCKET.amazonaws.com/ACCOUNT/requests/RANGE/etc/etc"