From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 0E3E2138BF3 for ; Tue, 18 Feb 2014 14:37:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B1C6EE0BA5; Tue, 18 Feb 2014 14:37:03 +0000 (UTC) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com [209.85.215.49]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 49415E0B79 for ; Tue, 18 Feb 2014 14:37:02 +0000 (UTC) Received: by mail-la0-f49.google.com with SMTP id y1so12213080lam.36 for ; Tue, 18 Feb 2014 06:37:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=J1oooIcfCzLzo6su9q6CoWt6QovGAiKDs+XzG8Qxfyc=; b=GlrxG06KX+1zdOCChUfaOAmt7yycOZg95iOdRMn1OOh9a0hBn7nH7xdhLgQ3QdjM/M KBloJ0KZpg1/uy37SSIFFOBbDF/iIopEyf4mSiDatYTlgMP9SktddtfZvcBA71rXVoaf C3TMsWmWK5rftvH30rWsrM/0wUIt53qMdtJyw0AO1HzvRyufQimVT8DQP8HmPXoZbSv3 yTAuLXdiFNxdxc7dqX1L9fqlhTaZnXoraX1llSfwmVkun0s1S2EZ7BVbpPDxziyXD9hb q3KCIEPGO5N1dSeZeZLgUhkNIkvE8Rl/yrNGjqIEfPUXy2vxfuTSG//ZR6B+MLWa50zd qCnA== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 X-Received: by 10.152.28.7 with SMTP id x7mr1716904lag.57.1392734220620; Tue, 18 Feb 2014 06:37:00 -0800 (PST) Received: by 10.114.170.67 with HTTP; Tue, 18 Feb 2014 06:37:00 -0800 (PST) In-Reply-To: <5ea6afc66880871ddec1398bab1e1f17.squirrel@www.antarean.org> References: <52FF84CE.2050301@libertytrek.org> <52FF9D58.3000608@libertytrek.org> <201402152023.10543.michaelkintzios@gmail.com> <5300DD51.5060207@libertytrek.org> <53010A8E.2050909@googlemail.com> <53012691.6040503@googlemail.com> <5ea6afc66880871ddec1398bab1e1f17.squirrel@www.antarean.org> Date: Tue, 18 Feb 2014 08:37:00 -0600 Message-ID: Subject: Re: [gentoo-user] Debian just voted in systemd for default init system in jessie From: =?UTF-8?B?Q2FuZWsgUGVsw6FleiBWYWxkw6lz?= To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: ef7be209-3ce9-43ab-a39c-acc74c77447f X-Archives-Hash: b4f7cd5de6246c3ef66eccfb72f68ab2 On Tue, Feb 18, 2014 at 3:54 AM, J. Roeleveld wrote: > On Sun, February 16, 2014 22:16, Canek Pel=C3=83=C2=A1ez Vald=C3=83=C2=A9= s wrote: >> On Sun, Feb 16, 2014 at 2:58 PM, Volker Armin Hemmann >> wrote: >>> oh? I can pipe that output into cat or any any daemon I like? Doesn't >>> look like so. >> >> But it does, you can "cat" with journalctl; it's one of its output >> options: >> >> -o, --output=3D >> cat >> generates a very terse output only showing the actual >> message of each journal entry with no meta data, not even a timestamp. > > As I do not have systemd installed on any machine, I can't check the > man-pages. They are online [1]. > But, if that is the only method to get parseable text from journalctl, > then that is less then useless. I only put that option as tongue-in-cheek, since someone complained about not being able to "cat" the logs. Many more options are available. > I would expect an export option providing the same detail level as I > currently find in /var/log/messages. > A timestamp is a minimum required for logging system output. Everybody agrees with that; that's why the journal supports a lot of formatting options. From [2]: -o, --output=3D Controls the formatting of the journal entries that are shown. Takes one of the following options: short is the default and generates an output that is mostly identical to the formatting of classic syslog files, showing one line per journal entry. short-iso is very similar, but shows ISO 8601 wallclock timestamps. short-precise is very similar, but shows timestamps with full microsecond precision. short-monotonic is very similar, but shows monotonic timestamps instead of wallclock timestamps. verbose shows the full-structured entry items with all fields. export serializes the journal into a binary (but mostly text-based) stream suitable for backups and network transfer (see Journal Export Format[1] for more information). json formats entries as JSON data structures, one per line (see Journal JSON Format[2] for more information). json-pretty formats entries as JSON data structures, but formats them in multiple lines in order to make them more readable for humans. json-sse formats entries as JSON data structures, but wraps them in a format suitable for Server-Sent Events[3]. cat generates a very terse output only showing the actual message of each journal entry with no meta data, not even a timestamp. So you can have the default; journalctl -b | head: -- Logs begin at Tue 2013-09-24 13:39:03 CDT, end at Tue 2014-02-18 08:28:44 CST. -- Feb 10 09:50:37 centurion systemd-journal[371]: Runtime journal is using 712.0K (max 198.0M, leaving 297.1M of free 1.9G, current limit 198.0M). Feb 10 09:50:37 centurion systemd-journal[371]: Runtime journal is using 716.0K (max 198.0M, leaving 297.1M of free 1.9G, current limit 198.0M). Feb 10 09:50:37 centurion systemd-journal[371]: Journal started Feb 10 09:50:37 centurion systemd-modules-load[370]: Inserted module 'fuse' Feb 10 09:50:37 centurion systemd[1]: Starting Swap. Feb 10 09:50:37 centurion systemd[1]: Reached target Swap. Feb 10 09:50:37 centurion systemd-modules-load[370]: Inserted module 'kvm_i= ntel' Feb 10 09:50:37 centurion systemd[1]: Starting Local File Systems. Feb 10 09:50:37 centurion systemd-journal[371]: Missed 107 kernel messages (The -b option shows the logs from the current boot; you can get the previous one with -b -1, the one before with -b -2, etc.) You can have short; journalctl -b -o short | head, which for the first lines of my current boot look the same as the default. You can have ISO timestamps; journalctl -b -o short-iso: -- Logs begin at Tue 2013-09-24 13:39:03 CDT, end at Tue 2014-02-18 08:31:54 CST. -- 2014-02-10T09:50:37-0600 centurion systemd-journal[371]: Runtime journal is using 712.0K (max 198.0M, leaving 297.1M of free 1.9G, current limit 198.0M). 2014-02-10T09:50:37-0600 centurion systemd-journal[371]: Runtime journal is using 716.0K (max 198.0M, leaving 297.1M of free 1.9G, current limit 198.0M). 2014-02-10T09:50:37-0600 centurion systemd-journal[371]: Journal started 2014-02-10T09:50:37-0600 centurion systemd-modules-load[370]: Inserted module 'fuse' 2014-02-10T09:50:37-0600 centurion systemd[1]: Starting Swap. 2014-02-10T09:50:37-0600 centurion systemd[1]: Reached target Swap. 2014-02-10T09:50:37-0600 centurion systemd-modules-load[370]: Inserted module 'kvm_intel' 2014-02-10T09:50:37-0600 centurion systemd[1]: Starting Local File Systems. 2014-02-10T09:50:37-0600 centurion systemd-journal[371]: Missed 107 kernel messages You can have nanosecond precision; journalctl -b -o short-precise | head: -- Logs begin at Tue 2013-09-24 13:39:03 CDT, end at Tue 2014-02-18 08:31:54 CST. -- Feb 10 09:50:37.689600 centurion systemd-journal[371]: Runtime journal is using 712.0K (max 198.0M, leaving 297.1M of free 1.9G, current limit 198.0M). Feb 10 09:50:37.689910 centurion systemd-journal[371]: Runtime journal is using 716.0K (max 198.0M, leaving 297.1M of free 1.9G, current limit 198.0M). Feb 10 09:50:37.690139 centurion systemd-journal[371]: Journal started Feb 10 09:50:37.690184 centurion systemd-modules-load[370]: Inserted module 'fuse' Feb 10 09:50:37.689866 centurion systemd[1]: Starting Swap. Feb 10 09:50:37.689902 centurion systemd[1]: Reached target Swap. Feb 10 09:50:37.689982 centurion systemd-modules-load[370]: Inserted module 'kvm_intel' Feb 10 09:50:37.690419 centurion systemd[1]: Starting Local File Systems. Feb 10 09:50:37.692022 centurion systemd-journal[371]: Missed 107 kernel messages You can have monotonic timestamps; journalctl -b -o short-monotonic | head: -- Logs begin at Tue 2013-09-24 13:39:03 CDT, end at Tue 2014-02-18 08:32:44 CST. -- [ 0.568295] centurion systemd-journal[371]: Runtime journal is using 712.0K (max 198.0M, leaving 297.1M of free 1.9G, current limit 198.0M). [ 0.568605] centurion systemd-journal[371]: Runtime journal is using 716.0K (max 198.0M, leaving 297.1M of free 1.9G, current limit 198.0M). [ 0.568834] centurion systemd-journal[371]: Journal started [ 0.569202] centurion systemd-modules-load[370]: Inserted module 'fuse' [ 0.569530] centurion systemd[1]: Starting Swap. [ 0.569823] centurion systemd[1]: Reached target Swap. [ 0.570157] centurion systemd-modules-load[370]: Inserted module 'kvm_in= tel' [ 0.570452] centurion systemd[1]: Starting Local File Systems. [ 0.570718] centurion systemd-journal[371]: Missed 107 kernel messages You can get it formatted with JSON; journalctl -b -o json | head -n 3: { "__CURSOR" : "s=3D12a9a4b1107f4a1e8219c6f392b59998;i=3D577;b=3D85b3bd9a29= 2b40da80a73aac41f06840;m=3D8abe7;t=3D4f20f4d08b300;x=3Dac5d8ecfe215e10f", "__REALTIME_TIMESTAMP" : "1392047437689600", "__MONOTONIC_TIMESTAMP" : "568295", "_BOOT_ID" : "85b3bd9a292b40da80a73aac41f06840", "PRIORITY" : "6", "_TRANSPORT" : "driver", "MESSAGE" : "Runtime journal is using 712.0K (max 198.0M, leaving 297.1M of free 1.9G, current limit 198.0M).", "MESSAGE_ID" : "ec387f577b844b8fa948f33cad9a75e6", "_PID" : "371", "_UID" : "0", "_GID" : "0", "_COMM" : "systemd-journal", "_EXE" : "/usr/lib64/systemd/systemd-journald", "_CMDLINE" : "/usr/lib/systemd/systemd-journald", "_CAP_EFFECTIVE" : "4402800cf", "_SYSTEMD_CGROUP" : "/system.slice/systemd-journald.service", "_SYSTEMD_UNIT" : "systemd-journald.service", "_SYSTEMD_SLICE" : "system.slice", "_MACHINE_ID" : "386846e50fae217775d8d80045a18054", "_HOSTNAME" : "centurion" } { "__CURSOR" : "s=3D12a9a4b1107f4a1e8219c6f392b59998;i=3D578;b=3D85b3bd9a29= 2b40da80a73aac41f06840;m=3D8ad1d;t=3D4f20f4d08b436;x=3D5d13a456b0fc099a", "__REALTIME_TIMESTAMP" : "1392047437689910", "__MONOTONIC_TIMESTAMP" : "568605", "_BOOT_ID" : "85b3bd9a292b40da80a73aac41f06840", "PRIORITY" : "6", "_TRANSPORT" : "driver", "MESSAGE_ID" : "ec387f577b844b8fa948f33cad9a75e6", "_PID" : "371", "_UID" : "0", "_GID" : "0", "_COMM" : "systemd-journal", "_EXE" : "/usr/lib64/systemd/systemd-journald", "_CMDLINE" : "/usr/lib/systemd/systemd-journald", "_CAP_EFFECTIVE" : "4402800cf", "_SYSTEMD_CGROUP" : "/system.slice/systemd-journald.service", "_SYSTEMD_UNIT" : "systemd-journald.service", "_SYSTEMD_SLICE" : "system.slice", "_MACHINE_ID" : "386846e50fae217775d8d80045a18054", "_HOSTNAME" : "centurion", "MESSAGE" : "Runtime journal is using 716.0K (max 198.0M, leaving 297.1M of free 1.9G, current limit 198.0M)." } { "__CURSOR" : "s=3D12a9a4b1107f4a1e8219c6f392b59998;i=3D579;b=3D85b3bd9a29= 2b40da80a73aac41f06840;m=3D8ae02;t=3D4f20f4d08b51b;x=3D656aa8fa8583d9dd", "__REALTIME_TIMESTAMP" : "1392047437690139", "__MONOTONIC_TIMESTAMP" : "568834", "_BOOT_ID" : "85b3bd9a292b40da80a73aac41f06840", "PRIORITY" : "6", "_TRANSPORT" : "driver", "_PID" : "371", "_UID" : "0", "_GID" : "0", "_COMM" : "systemd-journal", "_EXE" : "/usr/lib64/systemd/systemd-journald", "_CMDLINE" : "/usr/lib/systemd/systemd-journald", "_CAP_EFFECTIVE" : "4402800cf", "_SYSTEMD_CGROUP" : "/system.slice/systemd-journald.service", "_SYSTEMD_UNIT" : "systemd-journald.service", "_SYSTEMD_SLICE" : "system.slice", "_MACHINE_ID" : "386846e50fae217775d8d80045a18054", "_HOSTNAME" : "centurion", "MESSAGE" : "Journal started", "MESSAGE_ID" : "f77379a8490b408bbe5f6940505a777b" } Or pretty JSON; journalctl -b -o json-pretty | head -n 22: { "__CURSOR" : "s=3D12a9a4b1107f4a1e8219c6f392b59998;i=3D577;b=3D85b3bd9a292b40da80a73aac4= 1f06840;m=3D8abe7;t=3D4f20f4d08b300;x=3Dac5d8ecfe215e10f", "__REALTIME_TIMESTAMP" : "1392047437689600", "__MONOTONIC_TIMESTAMP" : "568295", "_BOOT_ID" : "85b3bd9a292b40da80a73aac41f06840", "PRIORITY" : "6", "_TRANSPORT" : "driver", "MESSAGE" : "Runtime journal is using 712.0K (max 198.0M, leaving 297.1M of free 1.9G, current limit 198.0M).", "MESSAGE_ID" : "ec387f577b844b8fa948f33cad9a75e6", "_PID" : "371", "_UID" : "0", "_GID" : "0", "_COMM" : "systemd-journal", "_EXE" : "/usr/lib64/systemd/systemd-journald", "_CMDLINE" : "/usr/lib/systemd/systemd-journald", "_CAP_EFFECTIVE" : "4402800cf", "_SYSTEMD_CGROUP" : "/system.slice/systemd-journald.service", "_SYSTEMD_UNIT" : "systemd-journald.service", "_SYSTEMD_SLICE" : "system.slice", "_MACHINE_ID" : "386846e50fae217775d8d80045a18054", "_HOSTNAME" : "centurion" } See if you can easily do that with rsyslog or syslog-ng. Regards. [1] http://www.freedesktop.org/software/systemd/man/ [2] http://www.freedesktop.org/software/systemd/man/journalctl.html Regards. --=20 Canek Pel=C3=A1ez Vald=C3=A9s Posgrado en Ciencia e Ingenier=C3=ADa de la Computaci=C3=B3n Universidad Nacional Aut=C3=B3noma de M=C3=A9xico