I have a graylog syslog server running on debian, running fine. I wanted to send syslogs from our Vmware ESX hosts to Graylog. I point a ESX host to the syslog by doing the following:
I open vSphere Client and selected my host. And then I select configuration... advanced settings, scroll down and expand Syslog and select global. Now under Syslog.global.loghost I put my server info-> udp://ipaddressofgraylog2:514 And I open the firewall for the syslog. Everything works at this end.
I go to my Graylog Server, and I see a ton of data being sent over. I adjust the host syslog output-> vCenter, select a host in the inventory, then the Configuration tab -> Advanced Settings -> Config -> HostAgent -> Log. Set logging level to "Error" (for now).
My problem:
I look closer at Graylog "HOSTS":
Graylog has 31 hosts listed, but there are really just 7 hosts. The syslog info from the ESX host(s) are not for a better word "tidy". My question is how I can make it "tidy"? If I have 3-4 ESX hosts sending their syslogs like this, parsing the info would be brutal.
Is this a graylog problem? Vmware ESX v5.5 problem?
ANSWER from mrlesmithjr link/script!
# Now we need to modify some things to get rsyslog to forward to graylog. this is useful for ESXi syslog format to be correct.
echo "Updating graylog2.conf and rsyslog.conf"
sed -i -e 's|syslog_listen_port = 514|syslog_listen_port = 10514|' /etc/graylog2.conf
sed -i -e 's|#$ModLoad immark|$ModLoad immark|' /etc/rsyslog.conf
sed -i -e 's|#$ModLoad imudp|$ModLoad imudp|' /etc/rsyslog.conf
sed -i -e 's|#$UDPServerRun 514|$UDPServerRun 514|' /etc/rsyslog.conf
sed -i -e 's|#$ModLoad imtcp|$ModLoad imtcp|' /etc/rsyslog.conf
sed -i -e 's|#$InputTCPServerRun 514|$InputTCPServerRun 514|' /etc/rsyslog.conf
sed -i -e 's|*.*;auth,authpriv.none|#*.*;auth,authpriv.none|' /etc/rsyslog.d/50-default.conf
echo '$template GRAYLOG2,"<%PRI%>1 %timegenerated:::date-rfc3339% %FROMHOST% %syslogtag% - %APP-NAME%: %msg:::drop-last-lf%\n"' | tee /etc/rsyslog.d/32-graylog2.conf
echo '$ActionForwardDefaultTemplate GRAYLOG2' | tee -a /etc/rsyslog.d/32-graylog2.conf
echo '$PreserveFQDN on' | tee -a /etc/rsyslog.d/32-graylog2.conf
echo '*.info @localhost:10514' | tee -a /etc/rsyslog.d/32-graylog2.conf