Syslog Forwarding
Logging Made Easy (LME) primarily collects host-based logs through installed agents. However, many devices that are critical to monitoring network and infrastructure activity (e.g., firewalls, routers, switches) do not support agent deployment.
To monitor these devices, LME supports syslog forwarding, allowing you to collect and analyze logs from across your network in a centralized platform. In this setup, the LME server acts as the centralized syslog receiver, accepting logs sent from network devices over Transmission Control Protocol (TCP). A TCP listener is configured through Elastic Agent’s Fleet integration to receive the incoming syslog traffic, making it searchable and actionable within Kibana alongside agent-based logs.
This guide provides instructions for setting up syslog forwarding to the LME server using the Elastic Stack’s TCP input and rsyslog.
Configure the TCP Integration in Kibana
Log into Kibana on the LME Server
Navigate toKibana server:
https://{SERVER_IP}Log in withusername andpassword.
Access the Fleet Menu
Click on thehamburger menu icon in the top left corner (three horizontal lines).
Scroll down and click onFleet.
Access Fleet Server Policy
Click on theAgent policies tab.
Click on theFleet-Server-Policy link.
Add Integration
Click on theAdd integration button.
Click on theCustom button in the left panel.
Click on theCustom TCP Logs icon.
Configure Settings
Click on theAdd Custom TCP Logs button.
Under the Configure integration section, click on theChange defaults drop-down menu.
Provide thefollowing information:
- Listen Address:0.0.0.0
- Listen port:5140
- Dataset name:tcp.syslog
- Addappropriate tags (e.g., syslog)
- EnableSyslog Parsing
- EnablePreserve Original Event
Click on theSave and continue button.
Update the Container Configuration
Navigate to theubuntu server.
Modify theLME Fleet Server quadlet to expose the syslog port:
- sudo nano /etc/containers/systemd/lme-fleet-server.container
Addport 5140 to PublishPort directive:
- PublishPort=8220:8220,5140:5140
Reloadsystemd and then restart thecontainer:
sudo systemctl daemon-reload
sudo systemctl restart lme-fleet-server.service
Verify that the port is listening:
- sudo ss -tulpn | grep 5140
Configure Rsyslog to Forward Logs
Create acustom rsyslog configuration:
- sudo nano /etc/rsyslog.d/60-forward-tcp.conf
Addforwarding directive:
*.* @@lme-server-ip:5140
Note: This is the IP address of your LME server. Ensure you can reach it from your device.
Restartrsyslog:
- sudo systemctl restart rsyslog
Generate Test Events
Createreal system events to test the setup:
- ssh nonexistentuser@localhost
Verify in Kibana
Generatefake ssh failures using ssh nonexistentuser@localhost on the endpoint.
Log intoKibana on the LME server.
Navigate to theKibana server:
https://{SERVER_IP}Log in withusername andpassword.
Access the Discover Menu
Click on thehamburger menu icon in the top left corner (three horizontal lines).
Click onDiscover.
Click on thedataview logs drop-down menu and then selectlogs-*.
In the Filter your data search bar, search for SSH-related entries by typingmessage:(“Failed passowrd” OR “invalid user” OR “authentication failure”).
Confirm the failed login attempts were captured.
Create Visualizations
Build ametric visualization for failed login attempts.
In the Filter your data search bar, typemessage:(“Failed passowrd” OR “invalid user” OR “authentication failure”).
Add thevisualization to the dashboard.