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 to Kibana server: :
https://{SERVER_IP}
- Log in with username and password.
- Navigate to Kibana server: :
Access the Fleet Menu
- Click on the hamburger menu icon in the top left corner (three horizontal lines).
- Scroll down and click on Fleet.
Access Fleet Server Policy
- Click on the Agent policies tab.
- Click on the Fleet-Server-Policy link.
Add Integration
- Click on the Add integration button.
- Click on Custom in the left panel.
- Click on the Custom TCP Logs icon.
Configure Settings
- Click on the Add Custom TCP Logs button.
- Under the Configure integration section, click on the Change defaults drop-down menu.
- Provide the following information:
- Listen Address: 0.0.0.0
- Listen port: 5140
- Dataset name: tcp.syslog
- Add appropriate tags (e.g., syslog)
- Enable Syslog Parsing
- Enable Preserve Original Event
- Click on the Save and continue button.
Update the Container Configuration
Navigate to the ubuntu server.
Modify the LME Fleet Server quadlet to expose the syslog port:
- sudo nano /etc/containers/systemd/lme-fleet-server.container
Add port 5140 to PublishPort directive:
- PublishPort=8220:8220,5140:5140
Reload systemd and then restart the container:
- sudo systemctl daemon-reload
- sudo systemctl restart lme-fleet-server.service
Verify the port is listening:
- sudo ss -tulpn | grep 5140
Configure Rsyslog to Forward Logs
Create a custom rsyslog configuration:
- sudo nano /etc/rsyslog.d/60-forward-tcp.conf
Add forwarding directive:
- . @@lme-server-ip:5140
Note: This is the IP address of your LME server. Ensure you can reach it from your device.
Restart rsyslog:
- sudo systemctl restart rsyslog
Generate Test Events
- Create real system events to test the setup:
- ssh nonexistentuser@localhost
Verify in Kibana
Generate fake ssh failures using ssh nonexistentuser@localhost on the endpoint.
**Log into Kibana on the LME server
- Navigate to Kibana server: :
https://{SERVER_IP}
- Log in with username and password.
- Navigate to Kibana server: :
Access the Discover Menu
- Click on the hamburger menu icon in the top left corner (three horizontal lines).
- Click on Discover.
Click on the dataview logs drop-down menu and then select logs-*.
In the Filter your data search bar, search for SSH-related entries by typing message:(“Failed passowrd” OR “invalid user” OR “authentication failure”).
Confirm the failed login attempts were captured.
Create Visualizations
Build a metric visualization for failed login attempts.
In the Filter your data search bar, type message:(“Failed passowrd” OR “invalid user” OR “authentication failure”).
Add the visualization to the dashboard.