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
new Rule: Avoid journalctl unit filtering #2959
Comments
Pretty niche feature ey? There has been a number of requests like this where someone want to see one command or other get special treatment. |
systemd is standard, not niche. |
I think you understand what I mean, but for others: |
I don't understand what you mean. There is no such thing as "shell internals", there are "shell builtins" and POSIX, |
Ok teacher. Present the PR and cross your fingers. |
I understood what he meant. |
On my system, The log is mostly ssh bot traffic, and Is this a known issue or something you discovered? It's expected that whichever command you try first will be orders of magnitude slower than the second due to disk caching, so does it hold up under repeated timing? |
@koalaman It looks like there are at least 5 ways to get logs ranging from 139.021s to 0.050s. cron and ssh are system services which journalctl optimizes, services that are not system (or journalctl is unsure of) like postfix* (or anything with a glob) are slow:
So it looks like glob is the worst offender that should be avoided or at least mitigated with --system. |
Relatedly the --quiet option should always be used in scripts to avoid the "-- No entries --" spam. |
I don't know much about systemd, but If Thanks for the suggestion! |
For new checks and feature suggestions
[Edited to reflect further testing]
Avoid using glob in journalctl -u --unit as it can be 3 orders of magnitude slower.
(4 orders of magnitude slower than grepping a log file)
Use the full service name
as listed in
instead of a glob
matching regex:
The text was updated successfully, but these errors were encountered: