Skip to content

Iterate over long time ranges instead of returning maximum range error #36

@edaemon

Description

@edaemon

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) 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions