{"id":1829,"date":"2014-09-15T00:41:51","date_gmt":"2014-09-14T16:41:51","guid":{"rendered":"http:\/\/blog.hoyo.idv.tw\/?p=1829"},"modified":"2017-05-08T13:21:29","modified_gmt":"2017-05-08T05:21:29","slug":"freebsd-rsyslog","status":"publish","type":"post","link":"https:\/\/blog.hoyo.idv.tw\/?p=1829","title":{"rendered":"FreeBSD RSysLog"},"content":{"rendered":"<p>\u53c3\u8003\u8cc7\u6e90\uff1a<a href=\"http:\/\/wiki.rsyslog.com\/index.php\/HOWTO_:_Rsyslog_%2B_MySQL_on_FreeBSD\" target=\"_blank\">HOWTO : Rsyslog + MySQL on FreeBSD<\/a><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"nums:false lang:mysql decode:true \">CREATE DATABASE Syslog;\r\nUSE Syslog;\r\nCREATE TABLE SystemEvents\r\n(\r\n    ID int unsigned not null auto_increment primary key,\r\n    CustomerID bigint,\r\n    ReceivedAt datetime NULL,\r\n    DeviceReportedTime datetime NULL,\r\n    Facility smallint NULL,\r\n    Priority smallint NULL,\r\n    FromHost varchar(60) NULL,\r\n    Message text,\r\n    NTSeverity int NULL,\r\n    Importance int NULL,\r\n    EventSource varchar(60),\r\n    EventUser varchar(60) NULL,\r\n    EventCategory int NULL,\r\n    EventID int NULL,\r\n    EventBinaryData text NULL,\r\n    MaxAvailable int NULL,\r\n    CurrUsage int NULL,\r\n    MinUsage int NULL,\r\n    MaxUsage int NULL,\r\n    InfoUnitID int NULL ,\r\n    SysLogTag varchar(60),\r\n    EventLogType varchar(60),\r\n    GenericFileName VarChar(60),\r\n    SystemID int NULL\r\n);\r\n\r\nCREATE TABLE SystemEventsProperties\r\n(\r\n    ID int unsigned not null auto_increment primary key,\r\n    SystemEventID int NULL ,\r\n    ParamName varchar(255) NULL ,\r\n    ParamValue text NULL\r\n);<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"nums:false lang:default decode:true \">mysql&gt; grant all privileges on Syslog.* to 'sysloguser'@'%' identified by 'syslogpass' with grant option<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"nums:false lang:default decode:true\">cd \/usr\/ports\/sysutils\/rsyslog7\r\nmake install clean\r\nee \/usr\/local\/etc\/rsyslog.conf<\/pre>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/litaotao.blog.51cto.com\/6224470\/1283871\" target=\"_blank\">RHEL 6.x \u642d\u5efarsyslog\u65e5\u5fd7\u670d\u52a1\u5668\u548cloganalyzer \u65e5\u5fd7\u5206\u6790\u5de5\u5177<\/a><\/p>\n<pre class=\"nums:false lang:default decode:true \">$ModLoad imuxsock.so\r\n$ModLoad imklog\r\n$ModLoad immark\r\n$ModLoad ommysql\r\n*.* :ommysql:localhost,Syslog,sysloguser,syslog<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"nums:false lang:default decode:true\">\/usr\/local\/etc\/rc.d\/rsyslogd restart<\/pre>\n<p>&nbsp;<\/p>\n<p>--<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"1829\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;1,377&nbsp;total views<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u53c3\u8003\u8cc7\u6e90\uff1aHOWTO : Rs...<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"1829\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;1,377&nbsp;total views<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[259],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/1829"}],"collection":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1829"}],"version-history":[{"count":12,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/1829\/revisions"}],"predecessor-version":[{"id":2684,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/1829\/revisions\/2684"}],"wp:attachment":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1829"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1829"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1829"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}