cloudflare / cloudflare/logshare

Iterate over long time ranges instead of returning maximum range error

Open
#36 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
81
Forks
23
PR merge metrics
No merged PRs in 30d

Description

Using `logshare-cli`, time ranges longer than an hour throw an error due to API limits. That's inconvenient when you want to examine the logs for multiple hours, days, etc.

```
[logshare-cli] 11:45:55 failed to fetch via timestamp: HTTP status 400: request failed: bad query: error parsing time: invalid time range: too long: maximum query range (difference between start and end) is 1h0m0s
```

Instead of making a request that will fail, could the client iterate over the time range, requesting the logs in hour-long chunks? I threw together a bash script to do this ([see here](https://gist.github.com/edaemon/ad29c753d854ae671b60ae66721ef57a)) but it seems more reasonable to handle it in the CLI client itself.

I'll have a crack at a PR but I'm not really familiar with Go.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.