Linux implementation Rsyslog Log the IP address record is not tested

Source: Internet
Author: User
Tags rsyslog

Before I was in BASHRC added a sentence, let the system operation log to Rsyslog send a copy of the content, now as long as the sending, and then get the current remote login IP add in it, like this

/etc/bashrc

1 sshclientip= ' W | Tail-n +3'BEGIN {ip= "local"}{if ($5== "0.00s" | | $! = "-") ip=$3 fi} END {print IP}' c6> '2 prompt_command='history-a > (tee-a ~/.bash_history | logger-p local1.debug-t "$SSH clientip[$USER] ")'

Linux implementation Rsyslog Log the IP address record is not tested

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.