Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to configure number of search results #97

Open
jmjpro opened this issue Dec 25, 2017 · 5 comments
Open

how to configure number of search results #97

jmjpro opened this issue Dec 25, 2017 · 5 comments

Comments

@jmjpro
Copy link

jmjpro commented Dec 25, 2017

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
Copy link

jareware commented Jan 29, 2018

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
Copy link

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

@mannykary
Copy link

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
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants