journalctl: add --exclude-identifier option#23086
Conversation
bluca
left a comment
There was a problem hiding this comment.
manpage update is missing. Also would be good to have a test/unit test for this, there should be already tests for the journal. Finally, rebase and squash fixup commits, so that history is clean. Would be good to have the two new options added as separate commits, since they are not related.
|
@bluca many thanks for your review!
Should I send them as different PRs or just 2 separate commits under one PR? I'll work on man/tests later on. |
same PR is fine by me |
6e08d96 to
aad68b2
Compare
|
@bluca I've re-ordered changes into 3 separate commits and added manpage update. |
There are tests for the journal in |
aad68b2 to
f01fb3a
Compare
|
@bluca thank you for pointing me out on them. I've added unit test for I'd like to discuss with you the test for We can't rely on As But I'm not sure it'll be available inside the testsuite. Should we add Thanks! |
Use |
f01fb3a to
aef1caf
Compare
|
@bluca added test for |
You need to add a |
e4ebadd to
eb6a37c
Compare
|
@bluca this time included. Thanks! |
The test is now failing on s390x, you can fetch the logs from https://autopkgtest.ubuntu.com/results/autopkgtest-focal-upstream-systemd-ci-systemd-ci/focal/s390x/s/systemd-upstream/20220416_143415_22e40@/artifacts.tar.gz |
e27669a to
f117805
Compare
77c6f18 to
34e4493
Compare
bf663b8 to
13490dd
Compare
bcf09c3 to
b53b1aa
Compare
Already resolved.
The idea looks similar, people do really want this functionality for a long time. @bluca Thanks a lot for your approval! @yuwata Thank you for the comments, everything is fixed now. Some CI failed due to GitHub API rate limit, nothing related to code :( |
yuwata
left a comment
There was a problem hiding this comment.
Currently, the new option only works with output type which uses output_short().
I think such feature should be implemented in sd-journal side.
But, this is a good start point. Let's take the current way, and extend the feature later.
b53b1aa to
45e3cb5
Compare
45e3cb5 to
df40392
Compare
The logger utility is now used in TEST-04-JOURNAL. See systemd/systemd#23086
Exclude syslog identifiers
There is
-t(--identifier=STRING) journalctl option which allows to specifySYSLOG_IDENTIFIERin a handy manner. This option could be used several times, each of them appends new layer of OR condition. A lot ofjournalctl(1)users are using it to show log entries related to only particular syslog identifiers. There are a lot of situations when it's required not to select a particular syslog identifiers, but to exclude some of them leaving all the others visible. There is a real problem in implementing this using Match* functionality built into journals as it match any part of the object by hash, while this could be effectively achieved during the journal entries output. This PR introduces-T(--exclude=STRING) option which implements this functionality for output_short (output_verbose, output_json, and others are intentionally left intact so far).Example: