Link to home
Start Free TrialLog in
Avatar of SrikantRajeev
SrikantRajeev

asked on

Syslog Server Configuration

I am running Syslog in one of Linux Servers.
All my network devices dump the logs into this server.
I want to make in such a way that log from a particular device to be sent into a particular folder. Currently all logs are dumped into a single folder.
But I want logs from a particular device to be dumped into a separate folder.
Avatar of larsrohr
larsrohr
Flag of United States of America image

I'd recommend checking out syslog-ng.
It can be configured to help sort your logs in that way.
Avatar of arnold
are all devices using the same facility?
local0-7 or are you looking to make the change without alterations to the device configuration? (ref syslog-ng from Larsrohr http:#a37586313)
Avatar of noci
noci

Try syslog-ng first. (like mentioned before, http:#a37586313).

If needed you can also use syslog-ng to dump data though pipes to applications for handling certain messages or put stuff into a database.  Or even filter the data before further processing.
Avatar of SrikantRajeev

ASKER

is it possible to make such a way that log from a particular device to be sent to a particular folder in the syslog server
Sure, syslog-ng can do that.

I'm not a current user of syslog-ng, so I may not be able to help much with the details of syslog-ng configuration.  But you can take a look at the syslog-ng Administrator Guide.
In particular, section 3.4.1. "Storing messages in plain-text files" describes saving logs to files, which looks easily modifiable to use separate directories for separate hosts, e.g.:
destination d_file {
        file("/var/log/$HOST/messages"
             template("$HOUR:$MIN:$SEC $TZ $HOST [$LEVEL] $MSG $MSG\n")
             template_escape(no));
};

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of noci
noci

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks