Centralized log management with Graylog
Setting Up the Graylog Inputs
For the Graylog server to receive graylog-ms
and graylog-node1
log messages from the clients, you need to create and configure inputs. To select an input, choose System in the Graylog web interface. Under the Inputs heading, select an input from the drop-down menu.
As you can see in Figure 4, the input setting specifies the network protocol used and the format of the log messages – you create a new input by clicking Launch new input. You then specify the configuration parameters, such as the port to use to finish creating the input. Figure 5 shows finished inputs for the UPD ports 12201 (GELF format) and 1514 (syslog format), which are available on two Graylog servers.
Collecting Data with Streams
Now that the infrastructure is completed, it is time to start collecting data. To keep track on specific events in log messages, such as failed login attempts in SSH or Windows Remote Desktop from Graylog, you need streams. A stream is a function in Graylog that analyzes log messages in real time based on defined criteria to classify them into predefined categories. For example, a rule might tell Graylog to collect all messages that include the string "root."
Streams are also the basis for defining Graylog alerts. In a stream, you can define conditions, such as, when to notify via email. For example: "If more than eight failed attempts to log in to the SSH service are made within one minute, generate and send an alert."
Streams are set up in the Graylog web interface in the Streams menu, by selecting Create stream. Then, choose a title for the new stream, and optionally a description, and click on Create stream and continue. Now define the rules (Stream rules) for detecting certain log messages, such as failed logon attempts. You can see an example of a stream for failed logon attempts detected on the Windows Remote Desktop (RDP) service in Figure 6.
To add a rule, select Add stream rule. Then set values for the fields Field, Type, and Value. The values for the first rule in the example are: Field: Channel
, Type: match exactly
, and Value: Security
.
You will want to decide which events to classify as critical in advance of implementation and then define them as stream rules.
Conclusion
With a suitable stream and ruleset, you can analyze critical log messages in real time and define appropriate escalation measures in the advent of trouble. In combination with an audit policy, you can handle a large volume of information.
Graylog and its flotilla of related applications provide a powerful, elegant, and inexpensive solution for centralizing log management on a diverse network.
Infos
- Graylog: https://www.graylog.org/
- Zen Load Balancer: https://www.zenloadbalancer.com/
- Zen Load Balancer Administration Guide: https://www.zenloadbalancer.com/zlb-administration-guide-v305/
- NXLog Community Edition Reference Manual: http://nxlog.org/docs/nxlog-ce/nxlog-reference-manual.html
- NXLog: http://nxlog-ce.sourceforge.net/download
- Graylog Extended Log Format: http://docs.graylog.org/en/latest/pages/gelf.html
« Previous 1 2 3
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.