Hi Syed and @trivedi.n,
I've been trying with a lab environment in order to show a little test of rsyslog.
I have tested it with a Wazuh manager on CentOS 7 and a Wazuh agent on Debian 8.
Wazuh manager
Edit /etc/rsyslog.conf on the Wazuh manager machine:
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$ModLoad imjournal # provides access to the systemd journal
# --> Starts the TCP server <---
$ModLoad imtcp
$InputTCPServerRun 514
$WorkDirectory /var/lib/rsyslog
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$IncludeConfig /etc/rsyslog.d/*.conf
$OmitLocalLogging on
$IMJournalStateFile imjournal.state
# --> Test file to throw every log on it <--
*.* /var/log/oneGiantHeapOfLogs.log
Once done, save and exit. Now we are going to start rsyslog on the Wazuh manager machine:
# set rsyslog enable
# systemctl restart rsyslog
Check if
rsyslog server is running on TCP/514:
# netstat -tulpn | grep rsyslog
tcp 0 0 0.0.0.0:514 0.0.0.0:* LISTEN 8751/rsyslogd
tcp6 0 0 :::514 :::* LISTEN 8751/rsyslogd
Wazu agent
Now, it's time to change to the Wazuh agent machine, please append this line to /etc/rsyslog.conf:
Where 192.168.1.143 is the Wazuh manager IP (rsyslog server IP).
# set rsyslog enable
# systemctl restart rsyslog
Testing
Now let's see a debug message sent from client and received on the server:
On the server machine (Wazuh manager), execute the following command:
# tailf /var/log/oneGiantHeapOfLogs.log
Where oneGiantHeapOfLogs.log is the file we configured on first step.
On the client machine (Wazuh agent), execute the following command:
# logger "Hello this is a test message"
On the tailf command output, you should see:
Apr 16 05:44:43 osboxes osboxes: Hello this is a test message
Where osboxes is my hostname for the Wazuh agent, and the date is the message date.
Once you guys have this test passed with a similar result, we will continue dig into Wazuh itself, to handle these logs ok?
Hope it helps, have a nice day.
Best regards,
Jesús