{"id":153409,"date":"2019-08-26T09:16:31","date_gmt":"2019-08-26T01:16:31","guid":{"rendered":"https:\/\/gulass.cn\/?p=153409"},"modified":"2019-08-12T17:18:41","modified_gmt":"2019-08-12T09:18:41","slug":"linux-configu-rsyslog","status":"publish","type":"post","link":"https:\/\/gulass.cn\/linux-configu-rsyslog.html","title":{"rendered":"linux\u4e0b\u914d\u7f6ersyslog\u65e5\u5fd7\u6536\u96c6\u670d\u52a1\u5668\u6848\u4f8b"},"content":{"rendered":"
centos6\u7cfb\u7edf client1\uff1a192.168.1.33<\/p>\n
centos7\u7cfb\u7edf client2\uff1a192.168.1.44<\/p>\n
centos7\u7cfb\u7edf master\uff1a192.168.1.55<\/p>\n
\u7b2c\u4e00\uff1a\u542f\u7528UDP\/TCP\u8fdb\u884c\u4f20\u8f93<\/p>\n
\r\nvim \/etc\/rsyslog.conf\r\n\r\n# Provides UDP syslog reception\t\t#\u82e5\u542f\u7528UDP\u8fdb\u884c\u4f20\u8f93\uff0c\u5219\u53d6\u6d88\u4e0b\u9762\u4e24\u884c\u7684\u6ce8\u91ca\r\n$ModLoad imudp\r\n$UDPServerRun 514\r\n\r\n# Provides TCP syslog reception\t\t#\u82e5\u542f\u7528TCP\u8fdb\u884c\u4f20\u8f93\uff0c\u5219\u53d6\u6d88\u4e0b\u9762\u4e24\u884c\u7684\u6ce8\u91ca\r\n#$ModLoad imtcp\r\n#$InputTCPServerRun 514\r\n<\/pre>\n\u7b2c\u4e8c\uff1a\u91cd\u542frsyslog\u670d\u52a1<\/p>\n
\r\nsystemctl restart rsyslog\r\n<\/pre>\n\u914d\u7f6e\u5ba2\u6237\u7aefclient\u7aef<\/strong><\/span><\/div>\n\u7b2c\u4e00\uff1a\u533a\u5206UDP\/TCP\u4f20\u8f93<\/p>\n
\r\nvim \/etc\/rsyslog.conf\r\n\r\n*.* @192.168.31.55:514\u3000\u3000\u3000\u3000\u3000#\u670d\u52a1\u7aef\u82e5\u542f\u7528TCP\u4f20\u8f93\u5219\u4f7f\u7528@@\uff0c\u82e5\u662fUDP\u5219\u4f7f\u7528@\r\n<\/pre>\n\u7b2c\u4e8c\uff1a\u91cd\u542frsyslog\u670d\u52a1<\/p>\n
\r\nsystemctl restart rsyslog\r\n\r\n\/etc\/init.d\/rsyslog restart\r\n<\/pre>\n\u6d4b\u8bd5\u670d\u52a1\u662f\u5426\u80fd\u591f\u5c06client\u7aef\u7684\u7cfb\u7edf\u65e5\u5fd7\u4f20\u56demaster\u7aef<\/strong><\/span><\/div>\n\u7b2c\u4e00\uff1a\u5728\u670d\u52a1\u7aef\u4e0d\u95f4\u65ad\u8f93\u51fa\u7cfb\u7edf\u65e5\u5fd7\u6587\u4ef6<\/p>\n
\r\ntailf \/var\/log\/messages\r\n<\/pre>\n\u7b2c\u4e8c\uff1a\u5728\u5ba2\u6237\u7aef\u4f7f\u7528logger\u751f\u6210\u6d4b\u8bd5\u65e5\u5fd7\u4fe1\u606f\uff08\u5e76\u67e5\u770b\u670d\u52a1\u5668\u7aef\u8f93\u51fa\uff0c\u5224\u65ad\u662f\u5426\u901a\u8fc7\u7f51\u7edc\u5c06\u65e5\u5fd7\u6536\u96c6\u5230\u4e86\uff09<\/p>\n
\r\nlogger \"this is ce shi xing xi\"\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"centos6\u7cfb\u7edf client1\uff1a192.168.1.33 centos7\u7cfb\u7edf client2\uff1a192.16 […]<\/p>\n","protected":false},"author":1479,"featured_media":154299,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-153409","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/153409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/1479"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=153409"}],"version-history":[{"count":2,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/153409\/revisions"}],"predecessor-version":[{"id":154302,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/153409\/revisions\/154302"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/154299"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=153409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=153409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=153409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}