{"action":"created","comment":{"url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/pulls/comments/35380665","id":35380665,"diff_hunk":"@@ -1,2 +1,71 @@\n # good-graylog2\n-Good reporter for graylog2\n+_Good Reporter For Graylog2_\n+\n+__Hapi:__ http://hapijs.com/","path":"README.md","position":5,"original_position":5,"commit_id":"b88d6d67b626ddb8e3ae93bd3cebf68d5d96804f","original_commit_id":"b88d6d67b626ddb8e3ae93bd3cebf68d5d96804f","user":{"login":"nackjicholson","id":365247,"avatar_url":"https://avatars.githubusercontent.com/u/365247?v=3","gravatar_id":"","url":"https://api.github.com/users/nackjicholson","html_url":"https://github.com/nackjicholson","followers_url":"https://api.github.com/users/nackjicholson/followers","following_url":"https://api.github.com/users/nackjicholson/following{/other_user}","gists_url":"https://api.github.com/users/nackjicholson/gists{/gist_id}","starred_url":"https://api.github.com/users/nackjicholson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nackjicholson/subscriptions","organizations_url":"https://api.github.com/users/nackjicholson/orgs","repos_url":"https://api.github.com/users/nackjicholson/repos","events_url":"https://api.github.com/users/nackjicholson/events{/privacy}","received_events_url":"https://api.github.com/users/nackjicholson/received_events","type":"User","site_admin":false},"body":"Yeah okay. You can also do this with `[myLinkCaption](http://mylink.com)`","created_at":"2015-07-23T22:47:57Z","updated_at":"2015-07-23T22:47:57Z","html_url":"https://github.com/CascadeEnergy/good-graylog2/pull/1#discussion_r35380665","pull_request_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/CascadeEnergy/good-graylog2/pulls/comments/35380665"},"html":{"href":"https://github.com/CascadeEnergy/good-graylog2/pull/1#discussion_r35380665"},"pull_request":{"href":"https://api.github.com/repos/CascadeEnergy/good-graylog2/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/pulls/1","id":40409957,"html_url":"https://github.com/CascadeEnergy/good-graylog2/pull/1","diff_url":"https://github.com/CascadeEnergy/good-graylog2/pull/1.diff","patch_url":"https://github.com/CascadeEnergy/good-graylog2/pull/1.patch","issue_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/issues/1","number":1,"state":"open","locked":false,"title":"SEN-1558 -- Good Reporter for Graylog2","user":{"login":"nwarlen","id":6005464,"avatar_url":"https://avatars.githubusercontent.com/u/6005464?v=3","gravatar_id":"","url":"https://api.github.com/users/nwarlen","html_url":"https://github.com/nwarlen","followers_url":"https://api.github.com/users/nwarlen/followers","following_url":"https://api.github.com/users/nwarlen/following{/other_user}","gists_url":"https://api.github.com/users/nwarlen/gists{/gist_id}","starred_url":"https://api.github.com/users/nwarlen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nwarlen/subscriptions","organizations_url":"https://api.github.com/users/nwarlen/orgs","repos_url":"https://api.github.com/users/nwarlen/repos","events_url":"https://api.github.com/users/nwarlen/events{/privacy}","received_events_url":"https://api.github.com/users/nwarlen/received_events","type":"User","site_admin":false},"body":"## Graylog Setup:\r\nFor the graylog server you are logging to: Ensure there is a _GELF_UDP_ input configured.\r\n\r\n## Hapi Setup:\r\nUse this in the same manner as `good-console`. The `config` passed into the reporter look like: \r\n```\r\nvar config = {\r\n  host: <graylog-host>\r\n  port: <gelf-udp-input-port>\r\n  container: <docker-container-id> //optional\r\n}\r\n```\r\n\r\n### To Test\r\n\r\nBuild a graylog box with the instructions provided here: http://docs.graylog.org/en/1.1/pages/installation/aws.html\r\n\r\nPut that box in a federation with your \"pym\"/\"dev\" box, and make sure you have ssh access via a security group as well.\r\nAs described in the graylog instructions, ssh into the graylog box once it's done building and run `sudo graylog-ctl reconfigure`\r\n\r\nOpen the url to the graylog server. Login as admin/admin\r\nGo to System -> Inputs\r\nCreate a GELF UDP input, give it a name \"gelfudp\" and submit it.\r\nOnce it's created hit \"show received messages\"\r\n\r\nssh into your pym box.\r\n\r\n```\r\ncd /var/cascade/\r\nmkdir good-graylog2-test\r\ncd good-graylog2-test\r\nnpm install nwarlen/good-graylog2#SEN-1558\r\nnpm install good hapi\r\nvim server.js\r\n```\r\n\r\npaste this into it. And then replace the \"host\" config with the Private IP of your graylog instance.\r\n\r\n```javascript\r\n'use strict';\r\n\r\nvar Hapi = require('hapi');\r\nvar good = require('good');\r\nvar graylogReporter = require('good-graylog2');\r\n\r\nvar server = new Hapi.Server();\r\n\r\nserver.connection({\r\n  port: 1234,\r\n  routes: {cors: true}\r\n});\r\n\r\n\r\nserver.route([\r\n  {\r\n    method: 'GET',\r\n    path: '/healthcheck',\r\n    handler: function(request, reply) {\r\n      reply('OK');\r\n    }\r\n  }\r\n]);\r\n\r\nvar goodOptions = {\r\n  reporters: [\r\n    {\r\n      reporter: graylogReporter,\r\n      events: {\r\n        response: '*',\r\n        log: '*',\r\n        error: '*'\r\n      },\r\n      config: {\r\n        service: 'service-name',\r\n        host: '172.21.78.148',\r\n        port: '12201',\r\n      }\r\n    }\r\n  ],\r\n  responsePayload: true\r\n};\r\n\r\nserver.register({ register: good, options: goodOptions }, function(err) {\r\n  if(err) {\r\n    server.log(['service-name', 'error'], err);\r\n  } else {\r\n    server.start(function() {\r\n      server.log(['service-name', 'info'], 'service-name running at: ' + server.info.uri);\r\n    });\r\n  }\r\n});\r\n```\r\n\r\n```\r\nnode server.js\r\n```\r\n\r\nRefresh the search in your browser window of graylog. Should see the server started log.","created_at":"2015-07-20T23:51:35Z","updated_at":"2015-07-23T22:47:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bf1db18972a63099d227303a1651b5b7cceba30e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/pulls/1/commits","review_comments_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/pulls/1/comments","review_comment_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/issues/1/comments","statuses_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/statuses/b88d6d67b626ddb8e3ae93bd3cebf68d5d96804f","head":{"label":"nwarlen:SEN-1558","ref":"SEN-1558","sha":"b88d6d67b626ddb8e3ae93bd3cebf68d5d96804f","user":{"login":"nwarlen","id":6005464,"avatar_url":"https://avatars.githubusercontent.com/u/6005464?v=3","gravatar_id":"","url":"https://api.github.com/users/nwarlen","html_url":"https://github.com/nwarlen","followers_url":"https://api.github.com/users/nwarlen/followers","following_url":"https://api.github.com/users/nwarlen/following{/other_user}","gists_url":"https://api.github.com/users/nwarlen/gists{/gist_id}","starred_url":"https://api.github.com/users/nwarlen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nwarlen/subscriptions","organizations_url":"https://api.github.com/users/nwarlen/orgs","repos_url":"https://api.github.com/users/nwarlen/repos","events_url":"https://api.github.com/users/nwarlen/events{/privacy}","received_events_url":"https://api.github.com/users/nwarlen/received_events","type":"User","site_admin":false},"repo":{"id":39409975,"name":"good-graylog2","full_name":"nwarlen/good-graylog2","owner":{"login":"nwarlen","id":6005464,"avatar_url":"https://avatars.githubusercontent.com/u/6005464?v=3","gravatar_id":"","url":"https://api.github.com/users/nwarlen","html_url":"https://github.com/nwarlen","followers_url":"https://api.github.com/users/nwarlen/followers","following_url":"https://api.github.com/users/nwarlen/following{/other_user}","gists_url":"https://api.github.com/users/nwarlen/gists{/gist_id}","starred_url":"https://api.github.com/users/nwarlen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nwarlen/subscriptions","organizations_url":"https://api.github.com/users/nwarlen/orgs","repos_url":"https://api.github.com/users/nwarlen/repos","events_url":"https://api.github.com/users/nwarlen/events{/privacy}","received_events_url":"https://api.github.com/users/nwarlen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nwarlen/good-graylog2","description":"Good reporter for graylog2","fork":true,"url":"https://api.github.com/repos/nwarlen/good-graylog2","forks_url":"https://api.github.com/repos/nwarlen/good-graylog2/forks","keys_url":"https://api.github.com/repos/nwarlen/good-graylog2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nwarlen/good-graylog2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nwarlen/good-graylog2/teams","hooks_url":"https://api.github.com/repos/nwarlen/good-graylog2/hooks","issue_events_url":"https://api.github.com/repos/nwarlen/good-graylog2/issues/events{/number}","events_url":"https://api.github.com/repos/nwarlen/good-graylog2/events","assignees_url":"https://api.github.com/repos/nwarlen/good-graylog2/assignees{/user}","branches_url":"https://api.github.com/repos/nwarlen/good-graylog2/branches{/branch}","tags_url":"https://api.github.com/repos/nwarlen/good-graylog2/tags","blobs_url":"https://api.github.com/repos/nwarlen/good-graylog2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nwarlen/good-graylog2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nwarlen/good-graylog2/git/refs{/sha}","trees_url":"https://api.github.com/repos/nwarlen/good-graylog2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nwarlen/good-graylog2/statuses/{sha}","languages_url":"https://api.github.com/repos/nwarlen/good-graylog2/languages","stargazers_url":"https://api.github.com/repos/nwarlen/good-graylog2/stargazers","contributors_url":"https://api.github.com/repos/nwarlen/good-graylog2/contributors","subscribers_url":"https://api.github.com/repos/nwarlen/good-graylog2/subscribers","subscription_url":"https://api.github.com/repos/nwarlen/good-graylog2/subscription","commits_url":"https://api.github.com/repos/nwarlen/good-graylog2/commits{/sha}","git_commits_url":"https://api.github.com/repos/nwarlen/good-graylog2/git/commits{/sha}","comments_url":"https://api.github.com/repos/nwarlen/good-graylog2/comments{/number}","issue_comment_url":"https://api.github.com/repos/nwarlen/good-graylog2/issues/comments{/number}","contents_url":"https://api.github.com/repos/nwarlen/good-graylog2/contents/{+path}","compare_url":"https://api.github.com/repos/nwarlen/good-graylog2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nwarlen/good-graylog2/merges","archive_url":"https://api.github.com/repos/nwarlen/good-graylog2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nwarlen/good-graylog2/downloads","issues_url":"https://api.github.com/repos/nwarlen/good-graylog2/issues{/number}","pulls_url":"https://api.github.com/repos/nwarlen/good-graylog2/pulls{/number}","milestones_url":"https://api.github.com/repos/nwarlen/good-graylog2/milestones{/number}","notifications_url":"https://api.github.com/repos/nwarlen/good-graylog2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nwarlen/good-graylog2/labels{/name}","releases_url":"https://api.github.com/repos/nwarlen/good-graylog2/releases{/id}","created_at":"2015-07-20T21:44:23Z","updated_at":"2015-07-20T21:43:33Z","pushed_at":"2015-07-22T22:28:34Z","git_url":"git://github.com/nwarlen/good-graylog2.git","ssh_url":"git@github.com:nwarlen/good-graylog2.git","clone_url":"https://github.com/nwarlen/good-graylog2.git","svn_url":"https://github.com/nwarlen/good-graylog2","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"CascadeEnergy:master","ref":"master","sha":"643cc129147a74df4ba0268f5f4aa821dae46ede","user":{"login":"CascadeEnergy","id":3847760,"avatar_url":"https://avatars.githubusercontent.com/u/3847760?v=3","gravatar_id":"","url":"https://api.github.com/users/CascadeEnergy","html_url":"https://github.com/CascadeEnergy","followers_url":"https://api.github.com/users/CascadeEnergy/followers","following_url":"https://api.github.com/users/CascadeEnergy/following{/other_user}","gists_url":"https://api.github.com/users/CascadeEnergy/gists{/gist_id}","starred_url":"https://api.github.com/users/CascadeEnergy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CascadeEnergy/subscriptions","organizations_url":"https://api.github.com/users/CascadeEnergy/orgs","repos_url":"https://api.github.com/users/CascadeEnergy/repos","events_url":"https://api.github.com/users/CascadeEnergy/events{/privacy}","received_events_url":"https://api.github.com/users/CascadeEnergy/received_events","type":"Organization","site_admin":false},"repo":{"id":39409939,"name":"good-graylog2","full_name":"CascadeEnergy/good-graylog2","owner":{"login":"CascadeEnergy","id":3847760,"avatar_url":"https://avatars.githubusercontent.com/u/3847760?v=3","gravatar_id":"","url":"https://api.github.com/users/CascadeEnergy","html_url":"https://github.com/CascadeEnergy","followers_url":"https://api.github.com/users/CascadeEnergy/followers","following_url":"https://api.github.com/users/CascadeEnergy/following{/other_user}","gists_url":"https://api.github.com/users/CascadeEnergy/gists{/gist_id}","starred_url":"https://api.github.com/users/CascadeEnergy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CascadeEnergy/subscriptions","organizations_url":"https://api.github.com/users/CascadeEnergy/orgs","repos_url":"https://api.github.com/users/CascadeEnergy/repos","events_url":"https://api.github.com/users/CascadeEnergy/events{/privacy}","received_events_url":"https://api.github.com/users/CascadeEnergy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CascadeEnergy/good-graylog2","description":"Good reporter for graylog2","fork":false,"url":"https://api.github.com/repos/CascadeEnergy/good-graylog2","forks_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/forks","keys_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/teams","hooks_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/hooks","issue_events_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/issues/events{/number}","events_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/events","assignees_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/assignees{/user}","branches_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/branches{/branch}","tags_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/tags","blobs_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/git/refs{/sha}","trees_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/statuses/{sha}","languages_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/languages","stargazers_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/stargazers","contributors_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/contributors","subscribers_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/subscribers","subscription_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/subscription","commits_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/commits{/sha}","git_commits_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/git/commits{/sha}","comments_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/comments{/number}","issue_comment_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/issues/comments{/number}","contents_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/contents/{+path}","compare_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/merges","archive_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/downloads","issues_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/issues{/number}","pulls_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/pulls{/number}","milestones_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/milestones{/number}","notifications_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/labels{/name}","releases_url":"https://api.github.com/repos/CascadeEnergy/good-graylog2/releases{/id}","created_at":"2015-07-20T21:43:33Z","updated_at":"2015-07-20T21:43:33Z","pushed_at":"2015-07-22T22:28:35Z","git_url":"git://github.com/CascadeEnergy/good-graylog2.git","ssh_url":"git@github.com:CascadeEnergy/good-graylog2.git","clone_url":"https://github.com/CascadeEnergy/good-graylog2.git","svn_url":"https://github.com/CascadeEnergy/good-graylog2","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CascadeEnergy/good-graylog2/pulls/1"},"html":{"href":"https://github.com/CascadeEnergy/good-graylog2/pull/1"},"issue":{"href":"https://api.github.com/repos/CascadeEnergy/good-graylog2/issues/1"},"comments":{"href":"https://api.github.com/repos/CascadeEnergy/good-graylog2/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/CascadeEnergy/good-graylog2/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/CascadeEnergy/good-graylog2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CascadeEnergy/good-graylog2/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/CascadeEnergy/good-graylog2/statuses/b88d6d67b626ddb8e3ae93bd3cebf68d5d96804f"}}}}