{"id":396,"date":"2025-02-21T23:36:35","date_gmt":"2025-02-21T21:36:35","guid":{"rendered":"https:\/\/olvas.dev\/?p=396"},"modified":"2025-02-21T23:36:36","modified_gmt":"2025-02-21T21:36:36","slug":"%d0%ba%d0%b0%d0%ba-%d1%80%d0%b0%d0%b7%d0%b1%d0%b8%d1%80%d0%b0%d1%82%d1%8c-%d0%bb%d0%be%d0%b3%d0%b8-%d0%b2-linux-journalctl-grep-awk-%d0%b8-sed","status":"publish","type":"post","link":"https:\/\/olvas.dev\/?p=396","title":{"rendered":"\u041a\u0430\u043a \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u0432 Linux: journalctl, grep, awk \u0438 sed"},"content":{"rendered":"\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0430\u0434\u043c\u0438\u043d \u0445\u043e\u0442\u044f&nbsp;\u0431\u044b \u0440\u0430\u0437 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441&nbsp;\u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0435\u0439, \u043a\u043e\u0433\u0434\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0442\u0443\u043f\u0438\u0442\u044c: \u043f\u043e\u0434\u0432\u0438\u0441\u0430\u044e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438, \u0447\u0442\u043e\u2011\u0442\u043e \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0418 \u043f\u0435\u0440\u0432\u0430\u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432&nbsp;\u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435&nbsp;\u2014 \u044d\u0442\u043e \u0436\u0443\u0440\u043d\u0430\u043b\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u0412&nbsp;Linux \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043b\u043e\u0433\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432&nbsp;<strong>systemd\u2011journald<\/strong>, \u0430&nbsp;\u0435\u0433\u043e \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f&nbsp;\u0440\u0430\u0431\u043e\u0442\u044b&nbsp;\u2014&nbsp;<code>journalctl<\/code>. \u041d\u043e&nbsp;\u043f\u0440\u043e\u0441\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u043b\u043e\u0433\u0438&nbsp;\u2014 \u044d\u0442\u043e \u0441\u043a\u0443\u0447\u043d\u043e. \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c,&nbsp;<strong>\u043a\u0430\u043a&nbsp;\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c, \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0431\u043e\u0440 \u043b\u043e\u0433\u043e\u0432<\/strong>&nbsp;\u0441&nbsp;\u043f\u043e\u043c\u043e\u0449\u044c\u044e&nbsp;<code>grep<\/code>,&nbsp;<code>awk<\/code>,&nbsp;<code>sed<\/code>&nbsp;\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0443\u0442\u0438\u043b\u0438\u0442.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 journalctl<\/h4>\n\n\n\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432&nbsp;\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0436\u0443\u0440\u043d\u0430\u043b\u044b&nbsp;\u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c&nbsp;<code>journalctl<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl<\/code><\/pre>\n\n\n\n<p>\u041d\u043e&nbsp;\u0435\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043e\u043b\u0433\u043e, \u043b\u043e\u0433\u043e\u0432 \u0442\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0433\u043e. \u0412\u044b\u0432\u0435\u0434\u0435\u043c \u0438\u0445 \u0431\u0435\u0437&nbsp;\u043f\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl --no-pager<\/code><\/pre>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u0432\u0438\u0441\u0430\u0435\u0442, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0436\u0443\u0440\u043d\u0430\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c \u0435\u0433\u043e \u043f\u043e&nbsp;\u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,&nbsp;<strong>\u0432\u044b\u0432\u0435\u0434\u0435\u043c \u043b\u043e\u0433\u0438 \u0437\u0430&nbsp;\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0447\u0430\u0441<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl --since \"1 hour ago\"<\/code><\/pre>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e&nbsp;\u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0442\u0441\u043b\u0435\u0434\u0438\u0442\u044c \u043d\u0435\u0434\u0430\u0432\u043d\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u041a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438?<\/h4>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0441\u044f, \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e&nbsp;\u0437\u0430\u043f\u0438\u0441\u0430\u043b\u043e\u0441\u044c \u0432&nbsp;\u043b\u043e\u0433\u0438&nbsp;<strong>\u043f\u043e\u0441\u043b\u0435 \u0441\u0442\u0430\u0440\u0442\u0430<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -b<\/code><\/pre>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u043b\u0430\u0441\u044c, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,&nbsp;<strong>\u043c\u0438\u043d\u0443\u0441 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -b -1<\/code><\/pre>\n\n\n\n<p>\u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e&nbsp;\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u043f\u0435\u0440\u0435\u0434 \u043f\u0430\u0434\u0435\u043d\u0438\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0443<\/h4>\n\n\n\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432&nbsp;\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,&nbsp;<code>nginx<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u043b\u0430\u0433&nbsp;<code>-u<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u nginx.service --no-pager<\/code><\/pre>\n\n\n\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Feb 02 10:15:00 myserver nginx&#91;1234]: Starting nginx: &#91;OK]\nFeb 02 10:16:00 myserver nginx&#91;1234]: 502 Bad Gateway<\/code><\/pre>\n\n\n\n<p>\u041c\u043e\u0436\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e&nbsp;<strong>\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u043e\u0442&nbsp;\u043d\u043e\u0432\u044b\u0445 \u043a&nbsp;\u0441\u0442\u0430\u0440\u044b\u043c<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u nginx.service --reverse<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">grep \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a<\/h4>\n\n\n\n<p>\u0416\u0443\u0440\u043d\u0430\u043b\u044b&nbsp;\u0431\u044b\u0432\u0430\u044e\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u043c\u0438, \u043d\u043e&nbsp;\u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0448\u0438\u0431\u043a\u0438. \u041e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c \u0438\u0445 \u0441&nbsp;\u043f\u043e\u043c\u043e\u0449\u044c\u044e&nbsp;<code>grep<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u nginx.service | grep \"error\"<\/code><\/pre>\n\n\n\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Feb 02 11:20:00 myserver nginx&#91;5678]: error: failed to bind socket\nFeb 02 11:22:00 myserver nginx&#91;5678]: error: no permission to access \/var\/www\/html<\/code><\/pre>\n\n\n\n<p>\u0427\u0442\u043e\u0431\u044b&nbsp;<strong>\u043d\u0435&nbsp;\u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442&nbsp;\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430<\/strong>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c&nbsp;<code>-i<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u nginx.service | grep -i \"error\"<\/code><\/pre>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440\u044c&nbsp;<code>ERROR<\/code>,&nbsp;<code>Error<\/code>&nbsp;\u0438&nbsp;<code>error<\/code>&nbsp;\u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0439\u0434\u0435\u043d\u044b.<\/p>\n\n\n\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0432\u0430\u0436\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0435&nbsp;\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u0443 \u043e\u0448\u0438\u0431\u043a\u0443, \u043d\u043e&nbsp;\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432\u043e\u043a\u0440\u0443\u0433. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,&nbsp;<strong>\u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043e&nbsp;\u0438 \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u nginx.service | grep -A 2 -B 2 \"error\"<\/code><\/pre>\n\n\n\n<p>\u0422\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e&nbsp;\u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e&nbsp;<strong>\u0434\u043e&nbsp;\u0438 \u043f\u043e\u0441\u043b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 awk<\/h4>\n\n\n\n<p>\u0416\u0443\u0440\u043d\u0430\u043b\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043c\u043d\u043e\u0433\u043e&nbsp;\u043b\u0438\u0448\u043d\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0441\u0442\u0430\u0432\u0438\u043c&nbsp;<strong>\u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u0442\u0443, \u0432\u0440\u0435\u043c\u044f \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u nginx.service | awk '{print $1, $2, $3, $6}'<\/code><\/pre>\n\n\n\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Feb 02 12:00:00 Starting\nFeb 02 12:05:00 error:\nFeb 02 12:10:00 Listening<\/code><\/pre>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0434\u043b\u0438\u043d\u043d\u044b\u0435, \u043c\u043e\u0436\u043d\u043e&nbsp;<strong>\u043e\u0431\u0440\u0435\u0437\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u nginx.service | awk '{print substr($0, index($0,$6))}'<\/code><\/pre>\n\n\n\n<p>\u042d\u0442\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0431\u0435\u0437&nbsp;\u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u041e\u0447\u0438\u0441\u0442\u043a\u0430 \u043b\u043e\u0433\u043e\u0432 \u0441 sed<\/h4>\n\n\n\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u043e\u0433\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u0442\u0435\u0433\u0438 \u0438\u043b\u0438&nbsp;\u043c\u0443\u0441\u043e\u0440\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443\u0431\u0435\u0440\u0451\u043c \u0432\u0441\u0451, \u0447\u0442\u043e&nbsp;\u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432&nbsp;\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445&nbsp;<code>[INFO]<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u nginx.service | sed 's\/\\&#91;.*\\]\/\/g'<\/code><\/pre>\n\n\n\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043b\u043e\u0433:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Feb 02 13:30:00 myserver nginx&#91;1234]: &#91;INFO] Server started<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Feb 02 13:30:00 myserver nginx&#91;1234]: Server started<\/code><\/pre>\n\n\n\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e&nbsp;<strong>\u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442<\/strong>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c&nbsp;<code>error<\/code>&nbsp;\u043d\u0430&nbsp;<code>!!!ERROR!!!<\/code>&nbsp;\u0434\u043b\u044f&nbsp;\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u nginx.service | sed 's\/error\/!!!ERROR!!!\/g'<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0431\u043e\u0440 \u043e\u0448\u0438\u0431\u043e\u043a<\/h4>\n\n\n\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043c\u044b \u043d\u0443\u0436\u043d\u043e&nbsp;<strong>\u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 Nginx<\/strong>&nbsp;\u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0432&nbsp;\u0444\u0430\u0439\u043b. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c&nbsp;<strong>crontab<\/strong>&nbsp;\u0438 \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u nginx.service --since \"1 day ago\" | grep -i \"error\" | awk '{print $1, $2, $3, $6, $7, $8}' &gt; \/var\/log\/nginx_errors.log<\/code><\/pre>\n\n\n\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u0434:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u0411\u0435\u0440\u0451\u0442 \u043b\u043e\u0433\u0438 Nginx \u0437\u0430\u00a0\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 24\u00a0\u0447\u0430\u0441\u0430.<\/li>\n\n\n\n<li>\u0418\u0449\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u00a0<code>\"error\"<\/code>.<\/li>\n\n\n\n<li>\u041e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u0442\u0443, \u0432\u0440\u0435\u043c\u044f \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435.<\/li>\n\n\n\n<li>\u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u00a0<code>\/var\/log\/nginx_errors.log<\/code>.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">\u0412\u044b\u0432\u043e\u0434 \u043b\u043e\u0433\u043e\u0432 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/h4>\n\n\n\n<p>\u0410&nbsp;\u0435\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f&nbsp;<strong>\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043b\u043e\u0433\u0438 \u0432&nbsp;\u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/strong>, \u0442\u043e<strong>&nbsp;<\/strong>\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0444\u043b\u0430\u0433&nbsp;<code>-f<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u nginx.service -f=<\/code><\/pre>\n\n\n\n<p>\u042d\u0442\u043e \u043a\u0430\u043a&nbsp;<code>tail -f<\/code>, \u043d\u043e&nbsp;\u0434\u043b\u044f&nbsp;journalctl&nbsp;\u2014 \u0432\u044b \u0441\u0440\u0430\u0437\u0443 \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0435\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u0443\u043f\u0430\u0434\u0451\u0442.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0430\u0434\u043c\u0438\u043d \u0445\u043e\u0442\u044f&nbsp;\u0431\u044b \u0440\u0430\u0437 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441&nbsp;\u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0435\u0439, \u043a\u043e\u0433\u0434\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0442\u0443\u043f\u0438\u0442\u044c: \u043f\u043e\u0434\u0432\u0438\u0441\u0430\u044e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438, \u0447\u0442\u043e\u2011\u0442\u043e \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0418 \u043f\u0435\u0440\u0432\u0430\u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432&nbsp;\u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435&nbsp;\u2014 \u044d\u0442\u043e \u0436\u0443\u0440\u043d\u0430\u043b\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u0412&nbsp;Linux \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043b\u043e\u0433\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432&nbsp;systemd\u2011journald, \u0430&nbsp;\u0435\u0433\u043e \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":397,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[51,52,53],"class_list":["post-396","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-likbez","tag-linux","tag-logs","tag-53","entry-card--landscape"],"_links":{"self":[{"href":"https:\/\/olvas.dev\/index.php?rest_route=\/wp\/v2\/posts\/396","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/olvas.dev\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/olvas.dev\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/olvas.dev\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/olvas.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=396"}],"version-history":[{"count":1,"href":"https:\/\/olvas.dev\/index.php?rest_route=\/wp\/v2\/posts\/396\/revisions"}],"predecessor-version":[{"id":398,"href":"https:\/\/olvas.dev\/index.php?rest_route=\/wp\/v2\/posts\/396\/revisions\/398"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/olvas.dev\/index.php?rest_route=\/wp\/v2\/media\/397"}],"wp:attachment":[{"href":"https:\/\/olvas.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/olvas.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/olvas.dev\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}