• 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 Save iptables Rules
  2. CIFS Share Filesystem Is Not Mounted after Reboot on CentOS/RHEL 7
  3. Linux / UNIX : How to create extended partition using fdisk
  4. How to Restart Network Services in CentOS/RHEL 8
  5. How to Setup SSH keys for “passwordless” SSH Login on CentOS/RHEL
  6. How to create and mount Btrfs file system (explained with examples)
  7. How to Configure rsyslog Server to Accept Logs via SSL/TLS
  8. How to enable CUPS Debugging on CentOS/RHEL
  9. LVM error “WARNING: Inconsistent metadata found” – How to resolve in CentOS / RHEL
  10. How to use rndc command (command-line administration tool for named)

You May Also Like

Primary Sidebar

Recent Posts

  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  • Unable to Start RDMA Services on CentOS/RHEL 7
  • How to rename a KVM VM with virsh
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary