Journald & Kubernetes

Systemd-journald is a logging service that centralizes the collection, storage, and management of system and application logs within a Kubernetes environment. It organizes logs into structured, indexed journals, enabling efficient querying and analysis of events from various system components, such as nodes, pods, and containers.

Prerequisites

If you are already using Middleware Kubernetes Agent then you can easily enable Jounrald scraping from Middleware UI.

Setup

Follow these steps to set up the Journald integration:

  1. In the Middleware UI, navigate to the Integrations page

  2. Go to Journald > Kubernetes Agent as shown in the image

Journald Integration Screen
  1. Click on the "Add Cluster" button, which will open a dropdown of available clusters and select the Cluster where you want to enable Prometheus Scraping
Journald Integration Screen

Advanced features :

Below are the configuration options you will see:

Select Cluster

Choose the cluster where journald logs are accessible.

Specify Journal Directory

By default the Agent looks for the journal at the following locations:

  • /var/log/journal

If your journal is located elsewhere, add a directory parameter with the corresponding journal path.

Define Units

By specifying units, you can filter and collect logs only from the relevant systemd services you are interested in. This helps reduce noise and enhances observability by focusing on critical logs. You can define a comma-separated list of units.

Examples:

ssh, kubelet, docker, containerd

How to Identify Units :

To find available units on your system, you can run the following command:

Log Priority

Configure the filter to include logs based on message priorities or priority ranges.

Once this configuration is complete, you should see the logs in the Logs section of your Middleware account. You can add the filter source: journald to view only journald logs.

Troubleshooting

Missing Integrations Menu

If you do not see the Integrations Menu in Middlware, that means your account has not been granted Installation permissions. Contact your system administrator to add the Installation permission to your user role in Settings.