• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How To Separate Each Of Syslog Client’s Messages Into Different File (CentOS/RHEL 6 and 7)

By admin

The below post explains steps to divert syslog to different files for each client.

1. Open and edit /etc/rsyslog.conf, then add below lines:

$template FILENAME,"/var/log/%fromhost-ip%/messages"
*.* ?FILENAME

2. Restart rsyslog service to take effect:

# systemctl restart rsyslog.service

or

# service rsyslog restart

3. Each of client’s messages will be generated dynamically depending on client’s IP address, for example:

/var/log/192.168.1.2/messages

Filed Under: CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL 6 : How to Disable / Enable direct root login via telnet
  2. Auditd Messages Are Filling Up /var/log/messages
  3. How to Remove virbr0 and lxcbr0 Interfaces on CentOS/RHEL 6,7
  4. SSH Login Stuck At : “debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP” CentOS/RHEL 7
  5. Understanding How an Email System Works
  6. Unable to start Nagios Service (CentOS/RHEL)
  7. CentOS / RHEL : How to adjust the telnet timeout (and how to disable it)
  8. How to modify snmp service to listen to an alternative port in CentOS/RHEL
  9. CentOS / RHEL 6,7 : How to recover an interrupted yum package installation
  10. How To Open A Port In CentOS / RHEL 7

You May Also Like

Primary Sidebar

Recent Posts

  • Basics of client connectivity in Oracle Data Guard configuration
  • ORA-354 ORA-353 and ORA-312: Possible corruption in Online Redo Log File Members in a Redo Log Group
  • How to relocate the redo log files to a different location on disk
  • Oracle Database: Redo log operations (Add/Drop/Change Location)
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary