{"action":"created","issue":{"url":"https://api.github.com/repos/splunk/splunk-javascript-logging/issues/6","repository_url":"https://api.github.com/repos/splunk/splunk-javascript-logging","labels_url":"https://api.github.com/repos/splunk/splunk-javascript-logging/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/splunk/splunk-javascript-logging/issues/6/comments","events_url":"https://api.github.com/repos/splunk/splunk-javascript-logging/issues/6/events","html_url":"https://github.com/splunk/splunk-javascript-logging/issues/6","id":153202944,"number":6,"title":"Can't send payload","user":{"login":"akzReekoh","id":15373150,"avatar_url":"https://avatars.githubusercontent.com/u/15373150?v=3","gravatar_id":"","url":"https://api.github.com/users/akzReekoh","html_url":"https://github.com/akzReekoh","followers_url":"https://api.github.com/users/akzReekoh/followers","following_url":"https://api.github.com/users/akzReekoh/following{/other_user}","gists_url":"https://api.github.com/users/akzReekoh/gists{/gist_id}","starred_url":"https://api.github.com/users/akzReekoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akzReekoh/subscriptions","organizations_url":"https://api.github.com/users/akzReekoh/orgs","repos_url":"https://api.github.com/users/akzReekoh/repos","events_url":"https://api.github.com/users/akzReekoh/events{/privacy}","received_events_url":"https://api.github.com/users/akzReekoh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"shakeelmohamed","id":1480063,"avatar_url":"https://avatars.githubusercontent.com/u/1480063?v=3","gravatar_id":"","url":"https://api.github.com/users/shakeelmohamed","html_url":"https://github.com/shakeelmohamed","followers_url":"https://api.github.com/users/shakeelmohamed/followers","following_url":"https://api.github.com/users/shakeelmohamed/following{/other_user}","gists_url":"https://api.github.com/users/shakeelmohamed/gists{/gist_id}","starred_url":"https://api.github.com/users/shakeelmohamed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shakeelmohamed/subscriptions","organizations_url":"https://api.github.com/users/shakeelmohamed/orgs","repos_url":"https://api.github.com/users/shakeelmohamed/repos","events_url":"https://api.github.com/users/shakeelmohamed/events{/privacy}","received_events_url":"https://api.github.com/users/shakeelmohamed/received_events","type":"User","site_admin":false},"assignees":[{"login":"shakeelmohamed","id":1480063,"avatar_url":"https://avatars.githubusercontent.com/u/1480063?v=3","gravatar_id":"","url":"https://api.github.com/users/shakeelmohamed","html_url":"https://github.com/shakeelmohamed","followers_url":"https://api.github.com/users/shakeelmohamed/followers","following_url":"https://api.github.com/users/shakeelmohamed/following{/other_user}","gists_url":"https://api.github.com/users/shakeelmohamed/gists{/gist_id}","starred_url":"https://api.github.com/users/shakeelmohamed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shakeelmohamed/subscriptions","organizations_url":"https://api.github.com/users/shakeelmohamed/orgs","repos_url":"https://api.github.com/users/shakeelmohamed/repos","events_url":"https://api.github.com/users/shakeelmohamed/events{/privacy}","received_events_url":"https://api.github.com/users/shakeelmohamed/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2016-05-05T10:05:33Z","updated_at":"2016-11-03T14:48:17Z","closed_at":null,"body":"Here's the code I'm using (got it directly from your npmjs page):\n\nvar SplunkLogger = require('splunk-logging').Logger;\n\nvar config = {\n    token: '<myToken>',\n    url: '<myInstance>'\n};\n\nvar Logger = new SplunkLogger(config);\n\nvar payload = {\n    // Message can be anything; doesn't have to be an object\n    message: {\n        temperature: \"70F\",\n        chickenCount: 500\n    }\n};\n\nconsole.log(\"Sending payload\", payload);\nLogger.send(payload, function(err, resp, body) {\n    // If successful, body will be { text: 'Success', code: 0 }\n    console.log(\"Response from Splunk\", body);\n});\n\nAnd I always get this error:\n/home/adinglasan/Desktop/splunk/node_modules/splunk-logging/splunklogger.js:466\n                if (!requestError && body && body.code.toString() !== \"0\") {\n                                                                       ^\n\nTypeError: Cannot read property 'toString' of undefined\n    at Request._callback (/home/adinglasan/Desktop/splunk/node_modules/splunk-logging/splunklogger.js:466:55)\n"},"comment":{"url":"https://api.github.com/repos/splunk/splunk-javascript-logging/issues/comments/258163868","html_url":"https://github.com/splunk/splunk-javascript-logging/issues/6#issuecomment-258163868","issue_url":"https://api.github.com/repos/splunk/splunk-javascript-logging/issues/6","id":258163868,"user":{"login":"calvinlfer","id":14280155,"avatar_url":"https://avatars.githubusercontent.com/u/14280155?v=3","gravatar_id":"","url":"https://api.github.com/users/calvinlfer","html_url":"https://github.com/calvinlfer","followers_url":"https://api.github.com/users/calvinlfer/followers","following_url":"https://api.github.com/users/calvinlfer/following{/other_user}","gists_url":"https://api.github.com/users/calvinlfer/gists{/gist_id}","starred_url":"https://api.github.com/users/calvinlfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calvinlfer/subscriptions","organizations_url":"https://api.github.com/users/calvinlfer/orgs","repos_url":"https://api.github.com/users/calvinlfer/repos","events_url":"https://api.github.com/users/calvinlfer/events{/privacy}","received_events_url":"https://api.github.com/users/calvinlfer/received_events","type":"User","site_admin":false},"created_at":"2016-11-03T14:48:17Z","updated_at":"2016-11-03T14:48:17Z","body":"Hey @shakeelmohamed, we get a type-error exception thrown because the Splunk forwarder fails to return a JSON response under heavy load. So `body` exists but `body.code` is undefined and `toString` is called on `body.code`. I can provide you the exact response shortly"}}
{"actor":{"display_login":"calvinlfer"}}