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

Limit number of rows returned #23

Open
ghost opened this issue Oct 24, 2012 · 2 comments
Open

Limit number of rows returned #23

ghost opened this issue Oct 24, 2012 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 24, 2012

It would be very handy if you could limit the number of rows returned.

e.g: papertrail -n 1 -s systemname

To return just the latest log line for a system.

@troy
Copy link
Contributor

troy commented Oct 26, 2012

Thanks for the suggestion, Robert. If you're comfortable sharing what led you to want the last message, that would be really helpful.

Also, would you use that instead of piping it through head -1 (if you've tried it)?

@ghost
Copy link
Author

ghost commented Oct 28, 2012

Yeah, piping it into tail is what i'm doing now.

What i'm using it for specifically is finding the most recent (i.e: last) message in papertrail for a host, to check that centralised messages are still being received for each host. It'd be even better if you could give -s systemname -l and get back the epoch time of the last message, or something, but limiting the rows returned and having to process the timestamp is also ok.

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

1 participant