Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Journalctl - how to restrict search to only certain boot IDs?

+1
−0

It seems like systemd labels every boot with some ID.

Suppose I have some sporadic issue that happens only on some boots. I want to search logs for only the boots that have the issue, not all boots. I don't want to spot check - because the issue is sporadic, it will have to be more systematic.

Suppose I get the boot IDs of interest in some simple format (suppose from https://linux.codidact.com/posts/292100) such as a text file with one ID per line. The list is long and changes often, I don't want to reformat it into a long string of CLI args.

Is there some way to tell journalctl:

Look only at logs for boots with the IDs from the file boots.txt

?

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

1 answer

+1
−0

Not directly, no. The argument -b only accepts a single id and using it multiple times only results in the last one being used.

You can however loop easily over the file and get the output of all consecutive journalctl -b runs in a single less:

while read BOOTID; do journalctl -b $BOOTID; done < boot.txt |less
History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

0 comment threads

Sign up to answer this question »