Is there a list of /var/log/messages event level keywords stored in a system file somewhere in CentOS 7 that would show all the possible "strings" to search for when grep'ing through /var/log/messages, or dmesg, etc?
I want to use a script for searching the most common or ALL possible events like err, error, failed, warning, kernel, etc.
Also, are the possible events different for logfiles messages, dmesg, cron, etc, or are the event keyswords all alike through the different log files?
Best Answer
The log priority is not stored in
/var/log/messages
at all.Like its predecessors,
rsyslog
uses the priority as a hint to determine where to route any given log message. By default, it does not log the priority itself.However, the systemd journal does log the priority (and keeps a lot of other interesting metadata). You can use the
-p
option tojournalctl
to narrow down log messages by priority.See the
journalctl
man page for all of the ways in which you can search the journal.