Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Recently i am trying to build a centralized rsyslog server - and tried with 2 node setup . 1 as master and 1 as slave - which sends the rsyslog to the central master. everything looks good until i tried to make a template and attempt the rsyslog in master to write the client's rsyslog to a custom location and file. things break and i don't get the logs generated in the central server.
below are my configs
#rsyslog.conf from the central/master server (local ip - 172.31.8.255) - configured to listen in tcp
When i tried to attempt to run with this custom conf in /etc/rsyslog.d at the master ..nothing writes to that dir/file. but without this the slave writes to the local syslog of the master with the slave's hostname and the rest of the details/syslog stuffs
Code:
root@rxmaster:/etc/rsyslog.d# cat rxslave.conf
if $fromhost == '172.31.9.228' then /logs/rx/rxslave/rxslavesyslog.log
& stop
I am sorry, but I am not familiar with Ubuntu.
I can only guarantee you that my settings work on CentOS 7.
The OSes differences seem to be only reason.
Besides, your working version seems very similar to mine.
Did you ensure that the /var/log/remote folder existed when testing mine?
I did not explicitly mentioned it, but my settings had two filters: one for server7.example.net and the other for the rest of *.example.net.
If I remember correctly :FROMHOST contains the fully qualfied name, not IP. Read the docs to find out what contains the IP.
That can be the reason your filters do not work.
Don't worry so much - btw i did ensure /var/log/remote was created and owned by syslog:adm .
and i have tried :FROMHOST with hostname too , which didn't work. i am not sure why. but it's ok.
the rsyslog is really simple in redhat/centos ... but in ubuntu is not too nice. but thank you anyways.
i will check your filters on ip too
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.