{"id":524,"date":"2021-01-15T19:38:39","date_gmt":"2021-01-15T16:38:39","guid":{"rendered":"http:\/\/tietokanta.dy.fi\/linux\/?p=524"},"modified":"2021-01-15T19:49:28","modified_gmt":"2021-01-15T16:49:28","slug":"journalctl","status":"publish","type":"post","link":"http:\/\/tietokanta.dy.fi\/linux\/index.php\/2021\/01\/15\/journalctl\/","title":{"rendered":"Journalctl"},"content":{"rendered":"\n<p>Journalctl k\u00e4ytt\u00e4minen terminaalissa.<\/p>\n\n\n\n<p>Oletusarvoisesti uudemmat systemd-pohjaiset Linux-j\u00e4rjestelm\u00e4t k\u00e4ytt\u00e4v\u00e4t nyt kahden lokipalvelun j\u00e4rjestelm\u00e4lokeja.<\/p>\n\n\n\n<ul><li>Systemd-journald, joka on m\u00e4\u00e4ritetty pit\u00e4m\u00e4\u00e4n lokeja vain muistissa eik\u00e4 se tallenna niit\u00e4 logeihin.<\/li><li>rsyslogd, joka vastaanottaa systemd-journaldin (ja muiden) l\u00e4hett\u00e4m\u00e4t viestit ja tallentaa ne levylle, yleisesti \/var\/log alikansioihin.<\/li><\/ul>\n\n\n\n<p>Viestien tarkastelemiseksi logipalvelusta voidaan k\u00e4ytt\u00e4\u00e4 journalctl-nimist\u00e4 ty\u00f6kalua. Jos sit\u00e4 k\u00e4ytet\u00e4\u00e4n ilman parametreja, se n\u00e4ytt\u00e4\u00e4 logipalvelusta koko sis\u00e4ll\u00f6n terminaaliin (oletusarvoisesti k\u00e4ytet\u00e4\u00e4n v\u00e4hemm\u00e4n). <br>Journalctl: n tulostusta terminaalissa voidaan muokata k\u00e4ytt\u00e4m\u00e4ll\u00e4 sek\u00e4 valitsimia ett\u00e4 suodattimia. Vaihtoehtoja voidaan k\u00e4ytt\u00e4\u00e4 n\u00e4ytett\u00e4vien rivien lukum\u00e4\u00e4r\u00e4n muuttamiseen, seurantatilan k\u00e4ytt\u00f6\u00f6nottoon, n\u00e4ytetyn kent\u00e4n muuttamiseen, ajanjakson m\u00e4\u00e4ritt\u00e4miseen jne. Suodattimien avulla voidaan muokata n\u00e4ytett\u00e4vi\u00e4 palveluita ja yksik\u00f6it\u00e4 koskevia tietoja, mit\u00e4 suoritettavia tietoja tietojen n\u00e4ytt\u00e4miseksi varten jne.<\/p>\n\n\n\n<p>Options:<br>&#8211;system Show the system journal<br>&#8211;user Show the user journal for the current user<br>-M &#8211;machine=CONTAINER Operate on local container<br>-S &#8211;since=DATE Show entries not older than the specified date<br>-U &#8211;until=DATE Show entries not newer than the specified date<br>-c &#8211;cursor=CURSOR Show entries starting at the specified cursor<br>&#8211;after-cursor=CURSOR Show entries after the specified cursor<br>&#8211;show-cursor Print the cursor after all the entries<br>-b &#8211;boot[=ID] Show current boot or the specified boot<br>&#8211;list-boots Show terse information about recorded boots<br>-k &#8211;dmesg Show kernel message log from the current boot<br>-u &#8211;unit=UNIT Show logs from the specified unit<br>&#8211;user-unit=UNIT Show logs from the specified user unit<br>-t &#8211;identifier=STRING Show entries with the specified syslog identifier<br>-p &#8211;priority=RANGE Show entries with the specified priority<br>-g &#8211;grep=PATTERN Show entries with MESSAGE matching PATTERN<br>&#8211;case-sensitive[=BOOL] Force case sensitive or insenstive matching<br>-e &#8211;pager-end Immediately jump to the end in the pager<br>-f &#8211;follow Follow the journal<br>-n &#8211;lines[=INTEGER] Number of journal entries to show<br>&#8211;no-tail Show all lines, even in follow mode<br>-r &#8211;reverse Show the newest entries first<br>-o &#8211;output=STRING Change journal output mode (short, short-precise,<br>short-iso, short-iso-precise, short-full,<br>short-monotonic, short-unix, verbose, export,<br>json, json-pretty, json-sse, json-seq, cat,<br>with-unit)<br>&#8211;output-fields=LIST Select fields to print in verbose\/export\/json modes<br>&#8211;utc Express time in Coordinated Universal Time (UTC)<br>-x &#8211;catalog Add message explanations where available<br>&#8211;no-full Ellipsize fields<br>-a &#8211;all Show all fields, including long and unprintable<br>-q &#8211;quiet Do not show info messages and privilege warning<br>&#8211;no-pager Do not pipe output into a pager<br>&#8211;no-hostname Suppress output of hostname field<br>-m &#8211;merge Show entries from all available journals<br>-D &#8211;directory=PATH Show journal files from directory<br>&#8211;file=PATH Show journal file<br>&#8211;root=ROOT Operate on files below a root directory<br>&#8211;interval=TIME Time interval for changing the FSS sealing key<br>&#8211;verify-key=KEY Specify FSS verification key<br>&#8211;force Override of the FSS key pair with &#8211;setup-keys<\/p>\n\n\n\n<p>Commands:<br>-h &#8211;help Show this help text<br>&#8211;version Show package version<br>-N &#8211;fields List all field names currently used<br>-F &#8211;field=FIELD List all values that a specified field takes<br>&#8211;disk-usage Show total disk usage of all journal files<br>&#8211;vacuum-size=BYTES Reduce disk usage below specified size<br>&#8211;vacuum-files=INT Leave only the specified number of journal files<br>&#8211;vacuum-time=TIME Remove journal files older than specified time<br>&#8211;verify Verify journal file consistency<br>&#8211;sync Synchronize unwritten journal messages to disk<br>&#8211;flush Flush all journal data from \/run into \/var<br>&#8211;rotate Request immediate rotation of the journal files<br>&#8211;header Show journal header information<br>&#8211;list-catalog Show all message IDs in the catalog<br>&#8211;dump-catalog Show entries in the message catalog<br>&#8211;update-catalog Update the message catalog database<br>&#8211;setup-keys Generate a new FSS key pair<\/p>\n\n\n\n<p>Yleisimpi\u00e4 valintoja ovat<\/p>\n\n\n\n<ul><li>journalctl -xe &#8220;n\u00e4ytt\u00e4\u00e4 viimeisimm\u00e4t virheilmoitukset.&#8221;<\/li><li>journalctl -ef &#8220;T\u00e4m\u00e4 pit\u00e4\u00e4 login auki n\u00e4yt\u00f6ll\u00e4 ja n\u00e4ytt\u00e4\u00e4 uudet viestit niiden saapuessa.&#8221;<\/li><li>journalctl -f -u apache &#8220;N\u00e4ytt\u00e4\u00e4 live-lokin\u00e4ytt\u00f6\u00e4 j\u00e4rjestelm\u00e4palvelusta apache.service.&#8221;<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Journalctl k\u00e4ytt\u00e4minen terminaalissa. Oletusarvoisesti uudemmat systemd-pohjaiset Linux-j\u00e4rjestelm\u00e4t k\u00e4ytt\u00e4v\u00e4t nyt kahden lokipalvelun j\u00e4rjestelm\u00e4lokeja. Systemd-journald, joka on m\u00e4\u00e4ritetty pit\u00e4m\u00e4\u00e4n lokeja vain muistissa eik\u00e4 se tallenna niit\u00e4 logeihin. rsyslogd, joka vastaanottaa systemd-journaldin (ja muiden) l\u00e4hett\u00e4m\u00e4t viestit ja tallentaa ne levylle, yleisesti \/var\/log alikansioihin. Viestien tarkastelemiseksi logipalvelusta voidaan k\u00e4ytt\u00e4\u00e4 journalctl-nimist\u00e4 ty\u00f6kalua. Jos sit\u00e4 k\u00e4ytet\u00e4\u00e4n ilman parametreja, se n\u00e4ytt\u00e4\u00e4 logipalvelusta &hellip; <a href=\"http:\/\/tietokanta.dy.fi\/linux\/index.php\/2021\/01\/15\/journalctl\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Journalctl<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/tietokanta.dy.fi\/linux\/index.php\/wp-json\/wp\/v2\/posts\/524"}],"collection":[{"href":"http:\/\/tietokanta.dy.fi\/linux\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/tietokanta.dy.fi\/linux\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/tietokanta.dy.fi\/linux\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/tietokanta.dy.fi\/linux\/index.php\/wp-json\/wp\/v2\/comments?post=524"}],"version-history":[{"count":2,"href":"http:\/\/tietokanta.dy.fi\/linux\/index.php\/wp-json\/wp\/v2\/posts\/524\/revisions"}],"predecessor-version":[{"id":526,"href":"http:\/\/tietokanta.dy.fi\/linux\/index.php\/wp-json\/wp\/v2\/posts\/524\/revisions\/526"}],"wp:attachment":[{"href":"http:\/\/tietokanta.dy.fi\/linux\/index.php\/wp-json\/wp\/v2\/media?parent=524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/tietokanta.dy.fi\/linux\/index.php\/wp-json\/wp\/v2\/categories?post=524"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/tietokanta.dy.fi\/linux\/index.php\/wp-json\/wp\/v2\/tags?post=524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}