Awk column extraction
Use awk to pull simple columns from logs.
Understand the pattern
Junior operators build confidence by gathering evidence before changing systems.
awk- Extract whitespace-delimited fields with the supported print patterns.
Quote awk programs so shell variable expansion does not consume $1; single quotes are usually appropriate.
journalctl- Read the training journal by unit or a bounded line window.
A relevant unit and time range are more useful than an unfiltered wall of logs.
Worked example and expected result
$ awk '{print $1}' /var/log/auth.logMay May May May
Exit status: 0. The command completed successfully in the training fixture.
$ awk '{print $5}' /var/log/auth.logsshd[104]: sshd[118]: sudo[126]: sshd[141]:
Exit status: 0. The command completed successfully in the training fixture.
$ journalctl -u ssh | awk '{print $5}'sshd[104]: sshd[118]: sshd[141]:
Exit status: 0. The command completed successfully in the training fixture.
Explain it
Apply it elsewhere
Keep the momentum.
Complete the lab, then explain and apply the pattern.
Next: Cut field selectionTry an incident drillAnonymous lesson and mastery progress lasts for this session. Sign in to keep synced lesson XP between sessions; mastery stays device-local. No speed bonus, lost lives, or hint penalties.