<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Centralized Logging – apt-upgrade.me – Homelab, Linux &amp; DevSecOps</title><link>https://www.apt-upgrade.me/tag/centralized-logging/</link><description>One nerd's homelab: Linux, Kubernetes, security, and the occasional disaster.</description><language>en-GB</language><lastBuildDate>Fri, 19 Dec 2025 20:00:00 +0100</lastBuildDate><atom:link href="https://www.apt-upgrade.me/tag/centralized-logging/index.xml" rel="self" type="application/rss+xml"/><item><title>Staring Into the Void: A Love Letter to Log Files</title><link>https://www.apt-upgrade.me/2025/12/19/staring-into-the-void-a-love-letter-to-log-files/</link><pubDate>Fri, 19 Dec 2025 20:00:00 +0100</pubDate><guid>https://www.apt-upgrade.me/2025/12/19/staring-into-the-void-a-love-letter-to-log-files/</guid><description>&lt;p&gt;&lt;strong&gt;In short:&lt;/strong&gt; Logs are where systems tell the truth – loud, sometimes ugly, but indispensable when something goes wrong. Today I installed &lt;a href="https://graylog.org/"&gt;Graylog&lt;/a&gt; and &lt;a href="https://fluentbit.io/"&gt;Fluent Bit&lt;/a&gt; on my server, as a learning environment close to what you would run in production. The post explains why logging matters so much and shows my Fluent Bit configuration.&lt;/p&gt;&#10;&lt;article class="wp-log-nerd-post"&gt;If you’ve ever stared at a terminal full of log messages, you know: logs are where systems&#10;tell the truth. They are noisy, sometimes ugly, but absolutely essential when things go wrong. Today I installed &lt;strong&gt;Graylog&lt;/strong&gt; and &lt;strong&gt;Fluent Bit&lt;/strong&gt; on my server. Not only&#10;because I work with these tools professionally, but also because I will increasingly use them in the future, as my homelab is meant for&#10;experimenting, learning, and keeping my brain busy.&lt;h2&gt;Why Logging Matters&lt;/h2&gt;&lt;p&gt;Logging is one of the most fundamental building blocks of reliable systems. Metrics tell you&#10;&lt;em&gt;that&lt;/em&gt; something is wrong, logs tell you &lt;em&gt;why&lt;/em&gt;. Centralised logging becomes crucial&#10;once you operate more than a single machine.&lt;/p&gt;&lt;h2&gt;Fluent Bit, Graylog &amp;amp; Sidecar&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Fluent Bit&lt;/strong&gt; acts as the client component on the server. Its job is simple:&#10;collect logs locally and ship them to Graylog.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Graylog&lt;/strong&gt; provides the GUI and backend where logs are stored, processed, searched,&#10;and used for alerting. It can easily be used to collect log messages from several thousand&#10;servers and analyse them centrally.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Sidecar&lt;/strong&gt; is an additional service that allows centralised configuration of the&#10;Fluent Bit agent directly from Graylog, making rollouts and changes much more convenient.&lt;/p&gt;&lt;h2&gt;Memory Tuning &amp;amp; First Lessons Learned&lt;/h2&gt;&lt;p&gt;Functionally everything worked quite well, but I had to significantly reduce the RAM&#10;requirements. Interestingly, Graylog immediately grabbed swap space — even though the server&#10;has a total of 32 GB RAM available.&lt;/p&gt;&lt;p&gt;These Java-related memory topics are still new to me, so that’s something I’ll have to dig&#10;deeper into. For the beginning, having a &lt;strong&gt;Grafana dashboard&lt;/strong&gt; was extremely&#10;helpful to monitor CPU and RAM usage in detail.&lt;/p&gt;&lt;p&gt;To limit heap usage, I added the following entry to&#10;&lt;code&gt;/etc/graylog/datanode/datanode.conf&lt;/code&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;opensearch_heap = 2g&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Fluent Bit Configuration Example&lt;/h2&gt;&lt;p&gt;The following is the current &lt;strong&gt;Fluent Bit&lt;/strong&gt; configuration running on my Ubuntu/Debian system. It collects logs from multiple local sources (systemd journal, syslog, auth logs, and kernel logs) and forwards everything to Graylog using the &lt;em&gt;GELF&lt;/em&gt; output over TCP.&lt;/p&gt;&lt;p&gt;This setup works well for a homelab environment while still being close to what you would run in production.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&amp;#10;############################################&amp;#10;# Fluent Bit – Ubuntu / Debian&amp;#10;############################################&amp;#10;&amp;#10;[SERVICE]&amp;#10; Flush 30&amp;#10; Daemon Off&amp;#10; Log_Level info&amp;#10; storage.type memory&amp;#10;&amp;#10;&amp;#10;###################################################################&amp;#10;# INPUTS&amp;#10;###################################################################&amp;#10;&amp;#10;# Systemd Journal (primary input source)&amp;#10;[INPUT]&amp;#10; Name systemd&amp;#10; Tag journal.*&amp;#10; Read_From_Tail On&amp;#10;&amp;#10;&amp;#10;# /var/log/syslog&amp;#10;[INPUT]&amp;#10; Name tail&amp;#10; Path /var/log/syslog&amp;#10; Tag syslog.*&amp;#10; DB /var/log/fluent-bit/db_syslog.db&amp;#10; Mem_Buf_Limit 5MB&amp;#10; Skip_Long_Lines On&amp;#10;&amp;#10;&amp;#10;# Authentication Logs&amp;#10;[INPUT]&amp;#10; Name tail&amp;#10; Path /var/log/auth.log&amp;#10; Tag auth.*&amp;#10;&amp;#10;&amp;#10;# Kernel Log&amp;#10;[INPUT]&amp;#10; Name tail&amp;#10; Path /var/log/kern.log&amp;#10; Tag kernel.*&amp;#10;&amp;#10;&amp;#10;###################################################################&amp;#10;# OUTPUT&amp;#10;###################################################################&amp;#10;&amp;#10;[OUTPUT]&amp;#10; Name gelf&amp;#10; Match *&amp;#10; Host 192.168.10.x&amp;#10; Port 12201&amp;#10; Mode udp&amp;#10; Gelf_Short_Message_Key log&amp;#10; Gelf_Host_Key host&amp;#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;With this configuration, Fluent Bit reliably ships all relevant system logs to Graylog,&#10;where they can be indexed, searched, and used for alerting.&lt;/p&gt;&lt;h2&gt;Final Thoughts&lt;/h2&gt;&lt;p&gt;Centralised logging is a powerful tool — even (or especially) in a homelab. It helps build&#10;intuition for production systems and makes troubleshooting far less painful when things&#10;eventually break.&lt;/p&gt;&lt;/article&gt;</description></item><item><title>📡 Shipping Logs Like a Pro: Fluent Bit Meets Ansible in My Homelab</title><link>https://www.apt-upgrade.me/2025/05/26/%F0%9F%93%A1-shipping-logs-like-a-pro-fluent-bit-meets-ansible-in-my-homelab/</link><pubDate>Mon, 26 May 2025 20:00:00 +0200</pubDate><guid>https://www.apt-upgrade.me/2025/05/26/%F0%9F%93%A1-shipping-logs-like-a-pro-fluent-bit-meets-ansible-in-my-homelab/</guid><description>&lt;p&gt;&lt;strong&gt;In short:&lt;/strong&gt; Almost a dozen VMs in my homelab mean lots of logs – and lots of chaos. Fluent Bit now collects them on every machine and ships them to a central &lt;a href="https://opensearch.org/"&gt;OpenSearch&lt;/a&gt; instance. It is rolled out with &lt;a href="https://www.ansible.com/"&gt;Ansible&lt;/a&gt;, to all VMs at once. The post shows configuration and playbook.&lt;/p&gt;&#10;&lt;p&gt;By now, my little homelab has grown into a small but mighty fleet of virtual machines — almost a dozen of them are humming along nicely. But with more services come more logs… and more chaos. 🌀&lt;/p&gt;</description></item></channel></rss>