papertrail / papertrail-cli

Command-line client for Papertrail hosted syslog & app log management service
http://papertrailapp.com/
MIT License
427 stars 46 forks source link

how to configure number of search results #97

Open jmjpro opened 6 years ago

jmjpro commented 6 years ago

With any query that would return more than 100 results the number of results is capped at 100. Is there a way to configure this via the CLI to increase the cap?

jareware commented 6 years ago

I'm also having this issue, which makes the CLI very hard to use for my purposes.

It looks like the limits are defined here, but they're not configurable via the CLI. It actually seems like it's just the pagination that's not working, but I can definitely confirm it's not:

$ papertrail something | wc -l
     100

...whereas the same query would have many hundreds of lines on the web UI.

rpbaptist commented 6 years ago

To be honest, this small limit is kind of pointless for searching log files.

mannykary commented 4 years ago

If you're comfortable with modifying the gem source code directly, you can modify self.initial_search_limit to a larger number than the default of 100: https://github.com/papertrail/papertrail-cli/blob/master/lib/papertrail/search_query.rb#L12-L14

I modified this file, which was located in a folder called papertrail-x.y.z (replace x.y.z with the version you have installed) in my Ruby gems folder.

jaredbeck commented 4 years ago

I think the limit of 100 does not apply if you limit the search in some way? For example, this was limited:

papertrail 3d889604fdca

But this was not:

papertrail --min-time '2020-05-04 14:20:00 UTC' 3d889604fdca

I'm using 0.11.0.

damienjbyrne commented 2 years ago

As a little hint for anyone who's interested and didn't realise, in the --min-time option you can also use relative times, i.e.:

papertrail --min-time '1 day ago' somesearch