{"id":410,"date":"2017-03-19T21:01:49","date_gmt":"2017-03-19T13:01:49","guid":{"rendered":"https:\/\/sora.sound.moe\/?p=410"},"modified":"2017-03-19T21:01:49","modified_gmt":"2017-03-19T13:01:49","slug":"graylog","status":"publish","type":"post","link":"https:\/\/sora.sound.moe\/?p=410","title":{"rendered":"Graylog"},"content":{"rendered":"<p>\u4eca\u5929\u5728\u601d\u8003\u65e5\u5fd7\u7684\u89e3\u51b3\u65b9\u6848\u7684\u65f6\u5019\uff0c\u5728 GitHub \u770b\u5230\u4e00\u4e2a\u633a\u6709\u610f\u601d\u7684\u9879\u76ee\u3002<\/p>\n<p><!--more--><\/p>\n<p>\u5f53\u524d\u5e02\u573a\u4e0a\u4e5f\u5b58\u5728\u4e00\u4e9b <a href=\"https:\/\/en.wikipedia.org\/wiki\/Logging_as_a_service\">LaaS (Logging as a Service)<\/a>\u00a0\u63d0\u4f9b\u5546\u3002\u6709\u7684\u7ba1\u81ea\u5df1\u53eb Cloud Logging\uff0c \u6709\u7684\u53eb\u81ea\u5df1 Centralized Logging\u3002\u6536\u8d39\u90fd\u8d3c\u8d35\u3002\u4e8e\u662f\u770b\u770b\u6709\u6ca1\u6709\u5f00\u6e90\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<p>\uff08\u8ffd\u8bb0\uff1aElastic \u63d0\u4f9b\u4e86\u4e00\u5957\u5de5\u5177\u94fe\uff0c\u6709\u65f6\u95f4\u53ef\u4ee5\u770b\u770b\u3002<a href=\"https:\/\/www.elastic.co\/products\/logstash\">https:\/\/www.elastic.co\/products\/logstash<\/a>\uff09<\/p>\n<p>\u4e8e\u662f\u641c\u5230\u00a0<a href=\"https:\/\/www.graylog.org\/\">Graylog<\/a>\u00a0\u3002GitHub \u4e0a\u53ea\u67093k\u4e0d\u5230\u7684Star\uff0c\u4e0d\u8fc7\u4e2a\u4eba\u8bd5\u7528\u4e86\u4e00\u4e0b\u4e0b\uff0c\u611f\u89c9\u7edd\u5bf9\u662f\u4e2a\u6709\u80cc\u666f\u7684\u9879\u76ee\u2026\u2026\u5de5\u4e1a\u7ea7\u7684\u3002<\/p>\n<p>\u5173\u4e8e\u5b89\u88c5\uff0c\u6587\u6863\u7684 Installing \u90e8\u5206\u51e0\u4e4e\u662f\u624b\u628a\u624b\u6559\u4f60\u4e86\u3002\u5176\u4e2d\u8fd8\u63d0\u4f9b\u4e86 VM \u7684\u89e3\u51b3\u65b9\u6848\uff0c\u8d3c\u5f3a\u3002\u53cd\u6b63\u6211\u8fd9\u8fb9\u662f\u628a\u95f2\u7f6e\u7684\u4e00\u53f0\u963f\u91cc\u4e91\u62ff\u6765\u505a\u8bd5\u9a8c\u4e86\u3002\u8fd9\u91cc\u5fc5\u987b\u55b7\u4e00\u4e0b\u963f\u91cc\u4e91\u6df1\u5733\u8282\u70b9\u7684\u51fa\u53e3\u3002\u4e0b\u4e86\u6211\u4e00\u4e2a\u591a\u5c0f\u65f6\u554a\uff0c\u4ec5\u4ec5100M\u7684\u4e1c\u897f\u3002\u987a\u4fbf\u4e00\u63d0\u963f\u91cc\u4e91\u51fa\u56fd\u5e26\u5bbd\u6700\u68d2\u7684\u4f3c\u4e4e\u662f\u5317\u4eac\u673a\u623f\u3002<\/p>\n<p>Graylog \u53ef\u4ee5\u7b97\u662f\u4f53\u91cf\u6bd4\u8f83\u5927\u7684\u73a9\u610f\u4e86\u2026\u2026 \u672c\u4f53 Java\u3001\u6570\u636e\u5b58\u50a8\u7d22\u5f15\u7528\u7684MongoDB + ElasticSearch\u3002<\/p>\n<p>\u5c0f\u8bb0\u4e00\u4e0b\u4e2a\u4eba\u5b89\u88c5\u9047\u5230\u7684\u5751\u3002 \u6211\u6309\u7167\u00a0<a href=\"http:\/\/docs.graylog.org\/en\/2.2\/pages\/installation\/os\/ubuntu.html\">Ubuntu installation<\/a>\u00a0\u7684\u6307\u5f15\u8fdb\u884c\u64cd\u4f5c\uff0c\u6700\u540e\u53d1\u73b0\u8fde\u4e0d\u4e0a Web Console\u3002\u89e3\u51b3\u65b9\u6848\u6700\u7b80\u5355\u7684\u5927\u6982\u662f\u91cd\u542f\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-large\" src=\"http:\/\/ww1.sinaimg.cn\/large\/a7e7af92gy1fdsf6n11y9j21hc0o1juo.jpg\" width=\"1920\" height=\"865\" \/><\/p>\n<p>Graylog \u63d0\u4f9b\u4e86\u591a\u6837\u7684\u65e5\u5fd7\u8f93\u5165\u65b9\u5f0f\u3002\u5305\u62ec\u76f4\u63a5\u63a5\u5165syslogd\u3001HTTP\/TCP\/UDP\u65b9\u5f0f\u63a5\u53d7GELF\uff08Graylog Extended Log Format\uff09\u7ed3\u6784\u5316\u65e5\u5fd7\u4fe1\u606f\u3001RabbitMQ\u7b49\u7b49\u2026\u2026\u4e5f\u6709\u8bb8\u591a\u8bed\u8a00\u7684SDK\uff08\u6709\u7684\u6709\u4e9b\u8fc7\u65f6\u4e86\uff09\u3002<\/p>\n<p>\u4e8e\u662f\u60f3\u8981\u63a5\u6536\u65e5\u5fd7\u4fe1\u606f\uff0c\u9996\u5148\u9700\u8981 System -&gt; Input \u91cc\u5efa\u7acb\u4e00\u4e2aInput\u3002\u7136\u540e\u5582\u70b9\u4e1c\u897f\u3002\u5c31\u53ef\u4ee5\u5728 Search \u9762\u677f\u67e5\u770b\u3002<img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-large\" src=\"http:\/\/ww1.sinaimg.cn\/large\/e985a6f7gy1fdsg6utcz9j21gd0m3n0j.jpg\" width=\"1885\" height=\"795\" \/><\/p>\n<p>\u6b64\u5916\u4e5f\u53ef\u4ee5\u6309\u7167\u6761\u4ef6\u8bbe\u5b9a Alert\u3002\u53ef\u4ee5 Email \u6216\u8005 Webhook \u3002\u529f\u80fd\u4e0a\u8fd8\u662f\u633a\u5168\u7684\u3002<\/p>\n<p>\u6253\u7b97\u63a5\u5165\u4e00\u4e9b\u4ec0\u4e48\u6df1\u5165\u7814\u7a76\u4e00\u4e0b\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>==================================<\/p>\n<p>GLEF HTTP \u4e00\u5f00\u59cb\u8bd5\u4e86\u51e0\u6b21\u4e5f\u6ca1\u6210\u529f\uff0c\u540e\u6765\u53d1\u73b0\u8fd9\u4e2a\u63a5\u53e3\u53ea\u5141\u8bb8 Raw JSON \u76f4\u63a5\u63d0\u4ea4\uff0c\u8868\u5355\u662f\u4e0d\u53ef\u4ee5\u7684\u3002<\/p>\n<p>\u6b64\u5916\u5173\u4e8e HTTPS \u7684\u65b9\u6848\uff0c\u6211\u6700\u7ec8\u9009\u62e9\u4e86\u7528 Nginx \u8f6c\u53d1 + Let&#8217;s Encrypt \u8bc1\u4e66\u3002<\/p>\n<p>\u6ce8\u610f\uff0cNginx Proxy \u9700\u8981\u8bbe\u7f6e\u4e00\u4e2a Header \u6765\u544a\u8bc9\u540e\u7aef API \u5730\u5740\u3002<\/p>\n<p><code>proxy_set_header X-Graylog-Server-URL https:\/\/graylog.example.org\/api<\/code><\/p>\n<p>\u8fd9\u91cc\u7684\u5730\u5740\u6362\u6210\u81ea\u5df1\u5b9e\u9645\u7684\u5730\u5740\u3002\u4e0d\u9700\u8981\u989d\u5916\u914d\u7f6e\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>============================<\/p>\n<p>GrayLog \u9ed8\u8ba4\u76d1\u542c\u7684\u5730\u5740\u662f127.0.0.1 \uff0c\u5982\u679c\u5e0c\u671b\u5916\u7f51\u8bbf\u95ee\uff0c\u5728\u914d\u7f6e\u4e2d\u628a Web Console \u7684\u76d1\u542c\u5730\u5740\u4fee\u6539\u4e3a 0.0.0.0 \u6216\u8005 IPv6 \u7684 :: \u5373\u53ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u5728\u601d\u8003\u65e5\u5fd7\u7684\u89e3\u51b3\u65b9\u6848\u7684\u65f6\u5019\uff0c\u5728 GitHub \u770b\u5230\u4e00\u4e2a\u633a\u6709\u610f\u601d\u7684\u9879\u76ee\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"twentyseventeen-featured-image":false,"twentyseventeen-thumbnail-avatar":false},"uagb_author_info":{"display_name":"Sora","author_link":"https:\/\/sora.sound.moe\/?author=1"},"uagb_comment_info":2,"uagb_excerpt":"\u4eca\u5929\u5728\u601d\u8003\u65e5\u5fd7\u7684\u89e3\u51b3\u65b9\u6848\u7684\u65f6\u5019\uff0c\u5728 GitHub \u770b\u5230\u4e00\u4e2a\u633a\u6709\u610f\u601d\u7684\u9879\u76ee\u3002","_links":{"self":[{"href":"https:\/\/sora.sound.moe\/index.php?rest_route=\/wp\/v2\/posts\/410"}],"collection":[{"href":"https:\/\/sora.sound.moe\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sora.sound.moe\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sora.sound.moe\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sora.sound.moe\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=410"}],"version-history":[{"count":0,"href":"https:\/\/sora.sound.moe\/index.php?rest_route=\/wp\/v2\/posts\/410\/revisions"}],"wp:attachment":[{"href":"https:\/\/sora.sound.moe\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=410"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sora.sound.moe\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=410"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sora.sound.moe\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}