SYS log server listening on TCP

If you want to have a TCP syslog server you can use one of the Unix/Unix-Like-Systems open source server which is syslog-ng
1> Update your app store. You should be the  root user to perform the following actions.

apt-get update

2> Install the syslog-ng:

apt-get install syslog-ng syslog-ng-core

3> After installation you have to edit a file “syslog-ng.conf”
path of the file is

/etc/syslog-ng/syslog-ng.conf
source s1
{
network( transport("tcp") port(514));
};
destination d1
{
file("/var/log/messages");
};
log
{
source(s1); destination(d1);
};

Here source s1 says from where to get the logs here I have specified anyone on protocol tcp port number 514 we can even specify IP address as well from which we want to get the logs. Destination d1 say where to save the logs. Log binds both source and destionation.
4> Check the logs

tail -f /var/log/messages ==> shows the live logs coming to the server

To check all the logs you can use the following commands

cat  tail -f /var/log/messages
Advertisements
This entry was posted in Linux. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s