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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • 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. Understanding multipath Utility to Configure DM-Multipath
  2. CentOS / RHEL 7 : How to remove rescue image using grubby
  3. How to Remove a Dead Mulitpath Device without Reboot in CentOS/RHEL
  4. How to Disable os-prober in CentOS/RHEL 7
  5. join Command Examples in Linux
  6. autorandr: command not found
  7. duc Command Examples in Linux
  8. burpsuit Command Examples in Linux
  9. RHEL 7 – RHCSA Notes : Create hard and soft links.
  10. apg – Creates arbitrarily complex random passwords (Command Examples)

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright