<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 14, 2020, 20:17 Mantas Mikulėnas <<a href="mailto:grawity@gmail.com">grawity@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">On Sat, Nov 14, 2020 at 11:31 AM Nikolaus Rath <<a href="mailto:Nikolaus@rath.org" target="_blank" rel="noreferrer">Nikolaus@rath.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I just discovered that on one of my systems journald only retains log<br>
entries for about 10 days:<br>
<br>
# journalctl | head -1<br>
-- Logs begin at Wed 2020-11-04 15:57:13 UTC, end at Sat 2020-11-14 09:28:19 UTC. --<br>
<br>
I do not understand what could cause this, because I have no retention<br>
limit configured, and the logs take up way less space than I have<br>
reserved:<br>
<br>
# journalctl --disk-usage<br>
Archived and active journals take up 320.0M in the file system.<br>
<br>
# journalctl > alllogs<br>
# ls -lh alllogs <br>
-rw-r--r-- 1 root root 27M Nov 14 09:24 alllogs<br></blockquote><div><br></div><div>That just shows the 'MESSAGE' field -- it does not show any other fields that each entry will have stored, such as the unit name which generated the message; the program's command line; and apparently even the original unparsed packet that was received through /dev/log. Try `journalctl -o export` to get a closer idea of what the messages in systemd-journal look like.</div><div><br></div><div>For example, on one of my servers, a plain `journalctl -a` outputs 260 MB of data, but `journalctl -o export` is 1.9 GB. (Which is still not quite the same as 2.4 GB of *.journal files, but there's always going to be some discrepancy due to how a binary database allocates space.)</div></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">One specific reason is that journal files are indexed – you can search them by any field value, without needing to do a full linear grep. (This is how "systemctl status" shows just one unit's logs, for example.) The indexes are stored along with the data, so the .journal files will be larger than the corresponding "-o export" dump.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>