{"id":350638,"date":"2023-07-22T15:00:17","date_gmt":"2023-07-22T15:00:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=350638"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=350638","title":{"rendered":"<span>\u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043b\u043e\u0433\u0430\u043c\u0438 \u0432 Linux<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>journalctl &#8212; \u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043b\u043e\u0433\u0430\u043c\u0438<\/h2>\n<p>\u0416\u0443\u0440\u043d\u0430\u043b \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u044d\u0442\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 systemd, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f Syslog, \u043b\u043e\u0433\u0438 \u044f\u0434\u0440\u0430, \u0432\u0441\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b (RAM, \u0434\u0438\u0441\u043a, boot, STDOUT\/STDERR \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432), \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0438\u0445 \u0438 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043b\u043e\u0433\u043e\u0432. \u0416\u0443\u0440\u043d\u0430\u043b (systemd journal) \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u0438\u043b\u0438 \u0432\u043c\u0435\u0441\u0442\u043e syslog \u0438\u043b\u0438 syslog-ng.<\/p>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 journalctl, \u0435\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0435\u0435 \u0441 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043b\u043e\u0433\u0430\u043c\u0438 \u0432 UNIX (tail, grep, sed, awk) \u0431\u043e\u043b\u0435\u0435 \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0436\u0443\u0440\u043d\u0430\u043b systemd \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0416\u0443\u0440\u043d\u0430\u043b systemd \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0438\u0441\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u043b\u043e\u0433\u0438 \u00ab\u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u044e\u0442\u00bb \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430\u043c\u0438:<\/p>\n<pre><code>journalctl --list-boots |head -n2  journalctl --list-boots |tail -n2 <\/code><\/pre>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>journalctl \u2013b<\/code> \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0432\u0441\u0435 \u043b\u043e\u0433\u0438 \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u043b\u043e\u0433\u0438 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0430, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u043e\u043c\u0435\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438:<\/p>\n<pre><code>journalctl -b -1 <\/code><\/pre>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u043b\u043e\u0433\u0438 \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u0445\u0440\u043e\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435:<\/p>\n<pre><code>journalctl -b --all --catalog --no-pager <\/code><\/pre>\n<p>\u0412\u0441\u0435 \u043b\u043e\u0433\u0438 \u0437\u0430 \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435:<\/p>\n<pre><code>journalctl --all --catalog --merge --no-pager <\/code><\/pre>\n<p>\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430, \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u0433\u0438 \u044f\u0434\u0440\u0430:<\/p>\n<pre><code>journalctl -b -k --no-pager <\/code><\/pre>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (\u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 tail \u2013f):<\/p>\n<pre><code>journalctl -f <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u0442\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u0436\u0443\u0440\u043d\u0430\u043b\u044b systemd \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 (\/var\/log\/journal\/):<\/p>\n<pre><code>journalctl --disk-usage <\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043b\u043e\u0433\u0438 \u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<pre><code>journalctl --output verbose <\/code><\/pre>\n<p>\u042d\u043a\u0441\u043f\u043e\u0440\u0442 \u043b\u043e\u0433\u043e\u0432 \u0432 \u0444\u0430\u0439\u043b:<\/p>\n<pre><code>journalctl --output export > export.log <\/code><\/pre>\n<h2>\u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u043b\u043e\u0433\u043e\u0432<\/h2>\n<p>\u041c\u043e\u0436\u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u043f\u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0443 (<a href=\"https:\/\/tools.ietf.org\/html\/rfc5424#section-6.2.1\" rel=\"noopener noreferrer nofollow\">RFC 5424 6.2.1<\/a>):<\/p>\n<pre><code>journalctl -f -p emerg journalctl -f -p alert journalctl -f -p crit journalctl -f -p err journalctl -f -p warning journalctl -f -p notice journalctl -f -p info journalctl -f -p debug <\/code><\/pre>\n<p>\u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u0433\u0438 c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c error, critical \u0438 alert:<\/p>\n<pre><code>journalctl -p err..alert <\/code><\/pre>\n<p>\u041b\u043e\u0433\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430:<\/p>\n<pre><code>journalctl -t NetworkManager <\/code><\/pre>\n<p>journalctl \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 &#8212; grep, awk:<\/p>\n<pre><code>journalctl -b | grep -i selinux <\/code><\/pre>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u043b\u0430\u0433 <code>-g<\/code> \u0438\u043b\u0438 <code>--grep<\/code>:<\/p>\n<pre><code>journalctl -g nginx  journalctl -b -g kube  journalctl -g fail --case-sensitive=true <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0438 grep <code>--grep<\/code> \u00ab\u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u00bb \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>journalctl --grep '(Started|Stopping)' <\/code><\/pre>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0448\u0442\u0430\u043c\u043f\u0430\u043c, \u0431\u0435\u0437 grep, awk \u0438 sed. \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>journalctl --since \"20 min ago\" <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0433\u0435\u043e\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0447\u0430\u0441\u043e\u0432\u044b\u0445 \u043f\u043e\u044f\u0441\u0430\u0445, \u0442\u043e journalctl \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0447\u0430\u0441\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u044f\u0441\u0430\u043c\u0438:<\/p>\n<pre><code>journalctl --since \"2023-06-21 14:24 Pacific\/Auckland\" --until \"2023-06-21 14:30 Europe\/Amsterdam\" <\/code><\/pre>\n<p>\u0416\u0443\u0440\u043d\u0430\u043b systemd \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043b\u043e\u0433\u0438 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435:<\/p>\n<pre><code>journalctl -o verbose --no-pager  Sat 2023-07-22 17:17:40.468870 MSK [s=8e997e4278d4420da4ee36deb1bcb537;i=48abc;b=200a318f51b04680a1207f58ed5aaf88;m=2199c4e719;t=601140b4770a0;x=59dabeebe46afe51]     _TRANSPORT=syslog     PRIORITY=6     SYSLOG_IDENTIFIER=sshd     _UID=0     _GID=0     _COMM=sshd     _EXE=\/usr\/sbin\/sshd     _CAP_EFFECTIVE=1ffffffffff     _SELINUX_CONTEXT=system_u:system_r:sshd_t:s0-s0:c0.c1023     _SYSTEMD_CGROUP=\/system.slice\/sshd.service     _SYSTEMD_UNIT=sshd.service     _SYSTEMD_SLICE=system.slice     _SYSTEMD_INVOCATION_ID=2c28dd046868493ca6c4ae9325b237b9     _BOOT_ID=200a318f51b04680a1207f58ed5aaf88     _MACHINE_ID=b0900a09b82b4ecca86af861e99e64c5     _HOSTNAME=Pythagoras     _RUNTIME_SCOPE=system     SYSLOG_FACILITY=10     _CMDLINE=\"sshd: unknown [priv]\"     SYSLOG_PID=1339341     _PID=1339341     SYSLOG_TIMESTAMP=Jul 22 17:17:40     MESSAGE=Connection closed by invalid user ubuntu 45.95.147.231 port 53778 [preauth] <\/code><\/pre>\n<p>\u0416\u0443\u0440\u043d\u0430\u043b systemd \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043b\u043e\u0433\u0438 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435:<\/p>\n<pre><code>journalctl _PID=1339341 <\/code><\/pre>\n<p>\u0418\u043b\u0438 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043b\u043e\u0433\u0438 \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043f\u0438\u0442\u043e\u043d\u0435:<\/p>\n<pre><code>journalctl _COMM=python <\/code><\/pre>\n<h2>JSON &#8212; \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438<\/h2>\n<p>journalctl \u0443\u043c\u0435\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043b\u043e\u0433\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 json \u2013 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 jq \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439:<\/p>\n<pre><code>journalctl --since \"1500 min ago\" -u kubelet.service -o json | jq .\"\"_CMDLINE\"\"  \"\/usr\/bin\/kubelet --bootstrap-kubeconfig=\/etc\/kubernetes\/bootstrap-kubelet.conf --kubeconfig=\/etc\/kubernetes\/kubelet.conf --config=\/var\/lib\/kubelet\/config.yaml --container-runtime-endpoint=unix:\/\/\/run\/containerd\/containerd.sock --node-ip=&lt;IP_ADDRESS> --node-labels=&lt;LABEL>\/cluster=true, --pod-infra-container-image=registry.k8s.io\/pause:3.9\" \"\/usr\/bin\/kubelet --bootstrap-kubeconfig=\/etc\/kubernetes\/bootstrap-kubelet.conf --kubeconfig=\/etc\/kubernetes\/kubelet.conf --config=\/var\/lib\/kubelet\/config.yaml --container-runtime-endpoint=unix:\/\/\/run\/containerd\/containerd.sock --node-ip=&lt;IP_ADDRESS> --node-labels=&lt;LABEL>\/cluster=true, --pod-infra-container-image=registry.k8s.io\/pause:3.9\" \"\/usr\/bin\/kubelet --bootstrap-kubeconfig=\/etc\/kubernetes\/bootstrap-kubelet.conf --kubeconfig=\/etc\/kubernetes\/kubelet.conf --config=\/var\/lib\/kubelet\/config.yaml --container-runtime-endpoint=unix:\/\/\/run\/containerd\/containerd.sock --node-ip=&lt;IP_ADDRESS> --node-labels=&lt;LABEL>\/cluster=true, --pod-infra-container-image=registry.k8s.io\/pause:3.9\" <\/code><\/pre>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043b\u043e\u0433\u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438. \u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0430\u0434\u043e \u00ab\u0445\u0430\u0447\u0438\u0442\u044c\u00bb \u043f\u044b\u0442\u0430\u044f\u0441\u044c \u0441\u043a\u043b\u0435\u0438\u0442\u044c sed, grep \u0438 awk \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445. \u041b\u044e\u0431\u043e\u0439 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 JSON.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0441\u0434\u0430\u044e\u0449\u0438\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439: \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 X \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u041f\u0440\u043e\u0441\u0442\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0430\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0434\u0435\u043c\u043e\u043d\u0430 Linux \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0435 systemd. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0435, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043b\u0435\u0434\u0443\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u0448\u0438\u043d\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 (kafka, rabbitmq, NATS) \u0438\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435:<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"go\">package main  import (         \"bufio\"         \"fmt\"         \"os\"         \"os\/exec\"         \"strings\" )  func main() {         \/\/ \u041e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u00abevents_topic\u00bb         cmdName := \"journalctl -t events_topic -f\"         cmdArgs := strings.Fields(cmdName)          cmd := exec.Command(cmdArgs[0], cmdArgs[1:len(cmdArgs)]...)         stdout, _ := cmd.StdoutPipe()         cmd.Start()         oneByte := make([]byte, 100)         num := 1         for {                 _, err := stdout.Read(oneByte)                 if err != nil {                         fmt.Printf(err.Error())                         break                 }                 r := bufio.NewReader(stdout)                 line, _, _ := r.ReadLine()                 fmt.Println(string(line))                 num = num + 1                 if num > 3 {                         os.Exit(0)                 }         } } <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u044e\u0449\u0443\u044e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0435:<\/p>\n<pre><code>go run watch.go Jul 22 15:49:25 Pythagoras events_topic[1293240]: NEW EVENT Jul 22 15:49:28 Pythagoras events_topic[1293250]: NEW EVENT <\/code><\/pre>\n<p>\u0410 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u044d\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c X \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b systemd-cat:<\/p>\n<pre><code>echo \"NEW EVENT\" | systemd-cat -t events_topic echo \"NEW EVENT\" | systemd-cat -t events_topic <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0436\u0443\u0440\u043d\u0430\u043b\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u043a\u0435\u0442 &#171;os\/exec&#187; \u2013 \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a:<br \/> <a href=\"https:\/\/github.com\/coreos\/go-systemd\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/coreos\/go-systemd<\/a><\/p>\n<p>\u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043b\u043e\u0433\u043e\u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 systemd. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 systemd \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0448\u0438\u0440\u0435 \u2013 \u043c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430\u043c\u0438 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/p>\n<h2>sos report &#8212; \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0438\u0433\u043e\u043b\u043a\u0443 \u0432 \u0441\u0442\u043e\u0433\u0435 \u0441\u0435\u043d\u0430<\/h2>\n<p><a href=\"https:\/\/github.com\/sosreport\/sos\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/sosreport\/sos<\/a><\/p>\n<p>\u041d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e\u0439, \u043d\u0435\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u043e\u0431\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u0438 \u0432\u044b\u0432\u043e\u0434\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430 \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u043d\u0443\u0436\u0435\u043d \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437, \u0441\u0432\u0435\u0440\u043a\u0430 \u043b\u043e\u0433\u043e\u0432\u043e \u0438 \u043c\u0435\u0442\u0440\u0438\u043a \u0432 \u0440\u0435\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0435, \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u043b\u043e\u0433\u043e\u0432.<\/p>\n<p>\u0414\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d sos report. \u042d\u0442\u043e \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u043b\u043e\u0433\u043e\u0432 \u0438 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e sos report \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0432 \u0441\u043e \u0432\u0441\u0435\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u2013 \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0444\u0444\u043b\u0430\u0439\u043d.<\/p>\n<p><strong>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 sosreport:<\/strong><\/p>\n<pre><code>yum install sos  apt install sosreport <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 Python. \u041b\u0435\u0433\u043a\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442\u0441\u044f. \u0414\u043b\u044f sos report \u0431\u044b\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432:<\/p>\n<pre><code>sos report --list-plugins  alternatives         System alternatives anaconda             Anaconda installer anacron              Anacron job scheduling service ata                  ATA and IDE information auditd               Audit daemon information block                Block device information boot                 Bootloader information cgroups              Control groups subsystem chrony               Chrony clock (for Network time protocol) cockpit              Cockpit Web Service conntrack            conntrack - netfilter connection tracking  ... <\/code><\/pre>\n<p>\u043f\u0440\u043e\u0444\u0438\u043b\u0435\u0439:<\/p>\n<pre><code>sos report --list-profiles  boot            boot, devices, dracut, grub2, services, systemd, udev cluster         conntrack container       cgroups, containers_common, podman, selinux  ... <\/code><\/pre>\n<p>\u0438 \u043f\u0440\u0435\u0441\u0435\u0442\u043e\u0432:<\/p>\n<pre><code>sos report --list-presets        name: none description: Do not load a preset        note: Use to disable automatically loaded presets         name: minimal description: Small and quick report that reduces sos report resource consumption        note: May be useful for low-resource systems, but may not provide sufficient data for analysis <\/code><\/pre>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u0435\u0439\u0441.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u043f\u043e\u0440\u0442\u0430:<\/p>\n<pre><code>sos report --all-logs --batch --tmp-dir=\/var <\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0430\u0440\u0445\u0438\u0432 \u0441 \u043b\u043e\u0433\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430:<\/p>\n<pre><code>Your sosreport has been generated and saved in: \/var\/tmp\/&lt;FILENAME>.tar.xz  Size20.25MiB Ownerroot sha256db71d185550428b5c3a12010fc76206b58b159671c6b74c2fce575254e388030 <\/code><\/pre>\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432, \u0432 \u0430\u0440\u0445\u0438\u0432\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0441 \u0432\u044b\u0432\u043e\u0434\u0430\u043c\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0443\u0442\u0438\u043b\u0438\u0442 \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code>tar -xf &lt;FILENAME>.tar.xz  boot  dmidecode    free            ip_addr   lib    lspci    proc    root-symlinks  sos_logs     uname   var date  environment  hostname        ip_route  lsmod  mount    ps      run            sos_reports  uptime  version.txt df    etc          installed-rpms  last      lsof   netstat  pstree  sos_commands   sys          usr     vgdisplay <\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u043f\u043e\u0440\u0442\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u043b\u0430\u0433\u043e\u0432 <code>--clean<\/code>, <code>--domains<\/code> \u0438 <code>--keywords<\/code> \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0444\u0443\u0441\u0446\u0438\u0440\u0432\u043e\u0430\u0442\u044c (\u043f\u043e\u0434\u0447\u0438\u0441\u0442\u0438\u0442\u044c) \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0430\u0440\u0445\u0438\u0432 \u0443\u0434\u0430\u043b\u0438\u0432 \u0432\u0441\u044e \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e.<\/p>\n<hr\/>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/749714\/\"> https:\/\/habr.com\/ru\/articles\/749714\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>journalctl &#8212; \u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043b\u043e\u0433\u0430\u043c\u0438<\/h2>\n<p>\u0416\u0443\u0440\u043d\u0430\u043b \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u044d\u0442\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 systemd, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f Syslog, \u043b\u043e\u0433\u0438 \u044f\u0434\u0440\u0430, \u0432\u0441\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b (RAM, \u0434\u0438\u0441\u043a, boot, STDOUT\/STDERR \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432), \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0438\u0445 \u0438 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043b\u043e\u0433\u043e\u0432. \u0416\u0443\u0440\u043d\u0430\u043b (systemd journal) \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u0438\u043b\u0438 \u0432\u043c\u0435\u0441\u0442\u043e syslog \u0438\u043b\u0438 syslog-ng.<\/p>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 journalctl, \u0435\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0435\u0435 \u0441 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043b\u043e\u0433\u0430\u043c\u0438 \u0432 UNIX (tail, grep, sed, awk) \u0431\u043e\u043b\u0435\u0435 \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0436\u0443\u0440\u043d\u0430\u043b systemd \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0416\u0443\u0440\u043d\u0430\u043b systemd \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0438\u0441\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u043b\u043e\u0433\u0438 \u00ab\u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u044e\u0442\u00bb \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430\u043c\u0438:<\/p>\n<pre><code>journalctl --list-boots |head -n2  journalctl --list-boots |tail -n2 <\/code><\/pre>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>journalctl \u2013b<\/code> \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0432\u0441\u0435 \u043b\u043e\u0433\u0438 \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u043b\u043e\u0433\u0438 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0430, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u043e\u043c\u0435\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438:<\/p>\n<pre><code>journalctl -b -1 <\/code><\/pre>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u043b\u043e\u0433\u0438 \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u0445\u0440\u043e\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435:<\/p>\n<pre><code>journalctl -b --all --catalog --no-pager <\/code><\/pre>\n<p>\u0412\u0441\u0435 \u043b\u043e\u0433\u0438 \u0437\u0430 \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435:<\/p>\n<pre><code>journalctl --all --catalog --merge --no-pager <\/code><\/pre>\n<p>\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430, \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u0433\u0438 \u044f\u0434\u0440\u0430:<\/p>\n<pre><code>journalctl -b -k --no-pager <\/code><\/pre>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (\u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 tail \u2013f):<\/p>\n<pre><code>journalctl -f <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u0442\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u0436\u0443\u0440\u043d\u0430\u043b\u044b systemd \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 (\/var\/log\/journal\/):<\/p>\n<pre><code>journalctl --disk-usage <\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043b\u043e\u0433\u0438 \u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<pre><code>journalctl --output verbose <\/code><\/pre>\n<p>\u042d\u043a\u0441\u043f\u043e\u0440\u0442 \u043b\u043e\u0433\u043e\u0432 \u0432 \u0444\u0430\u0439\u043b:<\/p>\n<pre><code>journalctl --output export > export.log <\/code><\/pre>\n<h2>\u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u043b\u043e\u0433\u043e\u0432<\/h2>\n<p>\u041c\u043e\u0436\u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u043f\u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0443 (<a href=\"https:\/\/tools.ietf.org\/html\/rfc5424#section-6.2.1\" rel=\"noopener noreferrer nofollow\">RFC 5424 6.2.1<\/a>):<\/p>\n<pre><code>journalctl -f -p emerg journalctl -f -p alert journalctl -f -p crit journalctl -f -p err journalctl -f -p warning journalctl -f -p notice journalctl -f -p info journalctl -f -p debug <\/code><\/pre>\n<p>\u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u0433\u0438 c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c error, critical \u0438 alert:<\/p>\n<pre><code>journalctl -p err..alert <\/code><\/pre>\n<p>\u041b\u043e\u0433\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430:<\/p>\n<pre><code>journalctl -t NetworkManager <\/code><\/pre>\n<p>journalctl \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 &#8212; grep, awk:<\/p>\n<pre><code>journalctl -b | grep -i selinux <\/code><\/pre>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u043b\u0430\u0433 <code>-g<\/code> \u0438\u043b\u0438 <code>--grep<\/code>:<\/p>\n<pre><code>journalctl -g nginx  journalctl -b -g kube  journalctl -g fail --case-sensitive=true <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0438 grep <code>--grep<\/code> \u00ab\u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u00bb \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>journalctl --grep '(Started|Stopping)' <\/code><\/pre>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0448\u0442\u0430\u043c\u043f\u0430\u043c, \u0431\u0435\u0437 grep, awk \u0438 sed. \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>journalctl --since \"20 min ago\" <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0433\u0435\u043e\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0447\u0430\u0441\u043e\u0432\u044b\u0445 \u043f\u043e\u044f\u0441\u0430\u0445, \u0442\u043e journalctl \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0447\u0430\u0441\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u044f\u0441\u0430\u043c\u0438:<\/p>\n<pre><code>journalctl --since \"2023-06-21 14:24 Pacific\/Auckland\" --until \"2023-06-21 14:30 Europe\/Amsterdam\" <\/code><\/pre>\n<p>\u0416\u0443\u0440\u043d\u0430\u043b systemd \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043b\u043e\u0433\u0438 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435:<\/p>\n<pre><code>journalctl -o verbose --no-pager  Sat 2023-07-22 17:17:40.468870 MSK [s=8e997e4278d4420da4ee36deb1bcb537;i=48abc;b=200a318f51b04680a1207f58ed5aaf88;m=2199c4e719;t=601140b4770a0;x=59dabeebe46afe51]     _TRANSPORT=syslog     PRIORITY=6     SYSLOG_IDENTIFIER=sshd     _UID=0     _GID=0     _COMM=sshd     _EXE=\/usr\/sbin\/sshd     _CAP_EFFECTIVE=1ffffffffff     _SELINUX_CONTEXT=system_u:system_r:sshd_t:s0-s0:c0.c1023     _SYSTEMD_CGROUP=\/system.slice\/sshd.service     _SYSTEMD_UNIT=sshd.service     _SYSTEMD_SLICE=system.slice     _SYSTEMD_INVOCATION_ID=2c28dd046868493ca6c4ae9325b237b9     _BOOT_ID=200a318f51b04680a1207f58ed5aaf88     _MACHINE_ID=b0900a09b82b4ecca86af861e99e64c5     _HOSTNAME=Pythagoras     _RUNTIME_SCOPE=system     SYSLOG_FACILITY=10     _CMDLINE=\"sshd: unknown [priv]\"     SYSLOG_PID=1339341     _PID=1339341     SYSLOG_TIMESTAMP=Jul 22 17:17:40     MESSAGE=Connection closed by invalid user ubuntu 45.95.147.231 port 53778 [preauth] <\/code><\/pre>\n<p>\u0416\u0443\u0440\u043d\u0430\u043b systemd \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043b\u043e\u0433\u0438 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435:<\/p>\n<pre><code>journalctl _PID=1339341 <\/code><\/pre>\n<p>\u0418\u043b\u0438 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043b\u043e\u0433\u0438 \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043f\u0438\u0442\u043e\u043d\u0435:<\/p>\n<pre><code>journalctl _COMM=python <\/code><\/pre>\n<h2>JSON &#8212; \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438<\/h2>\n<p>journalctl \u0443\u043c\u0435\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043b\u043e\u0433\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 json \u2013 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 jq \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439:<\/p>\n<pre><code>journalctl --since \"1500 min ago\" -u kubelet.service -o json | jq .\"\"_CMDLINE\"\"  \"\/usr\/bin\/kubelet --bootstrap-kubeconfig=\/etc\/kubernetes\/bootstrap-kubelet.conf --kubeconfig=\/etc\/kubernetes\/kubelet.conf --config=\/var\/lib\/kubelet\/config.yaml --container-runtime-endpoint=unix:\/\/\/run\/containerd\/containerd.sock --node-ip=&lt;IP_ADDRESS> --node-labels=&lt;LABEL>\/cluster=true, --pod-infra-container-image=registry.k8s.io\/pause:3.9\" \"\/usr\/bin\/kubelet --bootstrap-kubeconfig=\/etc\/kubernetes\/bootstrap-kubelet.conf --kubeconfig=\/etc\/kubernetes\/kubelet.conf --config=\/var\/lib\/kubelet\/config.yaml --container-runtime-endpoint=unix:\/\/\/run\/containerd\/containerd.sock --node-ip=&lt;IP_ADDRESS> --node-labels=&lt;LABEL>\/cluster=true, --pod-infra-container-image=registry.k8s.io\/pause:3.9\" \"\/usr\/bin\/kubelet --bootstrap-kubeconfig=\/etc\/kubernetes\/bootstrap-kubelet.conf --kubeconfig=\/etc\/kubernetes\/kubelet.conf --config=\/var\/lib\/kubelet\/config.yaml --container-runtime-endpoint=unix:\/\/\/run\/containerd\/containerd.sock --node-ip=&lt;IP_ADDRESS> --node-labels=&lt;LABEL>\/cluster=true, --pod-infra-container-image=registry.k8s.io\/pause:3.9\" <\/code><\/pre>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043b\u043e\u0433\u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438. \u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0430\u0434\u043e \u00ab\u0445\u0430\u0447\u0438\u0442\u044c\u00bb \u043f\u044b\u0442\u0430\u044f\u0441\u044c \u0441\u043a\u043b\u0435\u0438\u0442\u044c sed, grep \u0438 awk \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445. \u041b\u044e\u0431\u043e\u0439 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 JSON.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0441\u0434\u0430\u044e\u0449\u0438\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439: \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 X \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u041f\u0440\u043e\u0441\u0442\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0430\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0434\u0435\u043c\u043e\u043d\u0430 Linux \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0435 systemd. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0435, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043b\u0435\u0434\u0443\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u0448\u0438\u043d\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 (kafka, rabbitmq, NATS) \u0438\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435:<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"go\">package main  import (         \"bufio\"         \"fmt\"         \"os\"         \"os\/exec\"         \"strings\" )  func main() {         \/\/ \u041e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u00abevents_topic\u00bb         cmdName := \"journalctl -t events_topic -f\"         cmdArgs := strings.Fields(cmdName)          cmd := exec.Command(cmdArgs[0], cmdArgs[1:len(cmdArgs)]...)         stdout, _ := cmd.StdoutPipe()         cmd.Start()         oneByte := make([]byte, 100)         num := 1         for {                 _, err := stdout.Read(oneByte)                 if err != nil {                         fmt.Printf(err.Error())                         break                 }                 r := bufio.NewReader(stdout)                 line, _, _ := r.ReadLine()                 fmt.Println(string(line))                 num = num + 1                 if num > 3 {                         os.Exit(0)                 }         } } <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u044e\u0449\u0443\u044e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0435:<\/p>\n<pre><code>go run watch.go Jul 22 15:49:25 Pythagoras events_topic[1293240]: NEW EVENT Jul 22 15:49:28 Pythagoras events_topic[1293250]: NEW EVENT <\/code><\/pre>\n<p>\u0410 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u044d\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c X \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b systemd-cat:<\/p>\n<pre><code>echo \"NEW EVENT\" | systemd-cat -t events_topic echo \"NEW EVENT\" | systemd-cat -t events_topic <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0436\u0443\u0440\u043d\u0430\u043b\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u043a\u0435\u0442 &#171;os\/exec&#187; \u2013 \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a:<br \/> <a href=\"https:\/\/github.com\/coreos\/go-systemd\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/coreos\/go-systemd<\/a><\/p>\n<p>\u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043b\u043e\u0433\u043e\u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 systemd. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 systemd \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0448\u0438\u0440\u0435 \u2013 \u043c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430\u043c\u0438 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/p>\n<h2>sos report &#8212; \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0438\u0433\u043e\u043b\u043a\u0443 \u0432 \u0441\u0442\u043e\u0433\u0435 \u0441\u0435\u043d\u0430<\/h2>\n<p><a href=\"https:\/\/github.com\/sosreport\/sos\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/sosreport\/sos<\/a><\/p>\n<p>\u041d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e\u0439, \u043d\u0435\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u043e\u0431\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u0438 \u0432\u044b\u0432\u043e\u0434\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430 \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u043d\u0443\u0436\u0435\u043d \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437, \u0441\u0432\u0435\u0440\u043a\u0430 \u043b\u043e\u0433\u043e\u0432\u043e \u0438 \u043c\u0435\u0442\u0440\u0438\u043a \u0432 \u0440\u0435\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0435, \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u043b\u043e\u0433\u043e\u0432.<\/p>\n<p>\u0414\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d sos report. \u042d\u0442\u043e \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u043b\u043e\u0433\u043e\u0432 \u0438 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e sos report \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0432 \u0441\u043e \u0432\u0441\u0435\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u2013 \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0444\u0444\u043b\u0430\u0439\u043d.<\/p>\n<p><strong>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 sosreport:<\/strong><\/p>\n<pre><code>yum install sos  apt install sosreport <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 Python. \u041b\u0435\u0433\u043a\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442\u0441\u044f. \u0414\u043b\u044f sos report \u0431\u044b\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432:<\/p>\n<pre><code>sos report --list-plugins  alternatives         System alternatives anaconda             Anaconda installer anacron              Anacron job scheduling service ata                  ATA and IDE information auditd               Audit daemon information block                Block device information boot                 Bootloader information cgroups              Control groups subsystem chrony               Chrony clock (for Network time protocol) cockpit              Cockpit Web Service conntrack            conntrack - netfilter connection tracking  ... <\/code><\/pre>\n<p>\u043f\u0440\u043e\u0444\u0438\u043b\u0435\u0439:<\/p>\n<pre><code>sos report --list-profiles  boot            boot, devices, dracut, grub2, services, systemd, udev cluster         conntrack container       cgroups, containers_common, podman, selinux  ... <\/code><\/pre>\n<p>\u0438 \u043f\u0440\u0435\u0441\u0435\u0442\u043e\u0432:<\/p>\n<pre><code>sos report --list-presets        name: none description: Do not load a preset        note: Use to disable automatically loaded presets         name: minimal description: Small and quick report that reduces sos report resource consumption        note: May be useful for low-resource systems, but may not provide sufficient data for analysis <\/code><\/pre>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u0435\u0439\u0441.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u043f\u043e\u0440\u0442\u0430:<\/p>\n<pre><code>sos report --all-logs --batch --tmp-dir=\/var <\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0430\u0440\u0445\u0438\u0432 \u0441 \u043b\u043e\u0433\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430:<\/p>\n<pre><code>Your sosreport has been generated and saved in: \/var\/tmp\/&lt;FILENAME>.tar.xz  Size20.25MiB Ownerroot sha256db71d185550428b5c3a12010fc76206b58b159671c6b74c2fce575254e388030 <\/code><\/pre>\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-350638","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/350638","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=350638"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/350638\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=350638"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=350638"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=350638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}