-
Notifications
You must be signed in to change notification settings - Fork 48
Description
Here's the code I'm using (got it directly from your npmjs page):
var SplunkLogger = require('splunk-logging').Logger;
var config = {
token: '',
url: ''
};
var Logger = new SplunkLogger(config);
var payload = {
// Message can be anything; doesn't have to be an object
message: {
temperature: "70F",
chickenCount: 500
}
};
console.log("Sending payload", payload);
Logger.send(payload, function(err, resp, body) {
// If successful, body will be { text: 'Success', code: 0 }
console.log("Response from Splunk", body);
});
And I always get this error:
/home/adinglasan/Desktop/splunk/node_modules/splunk-logging/splunklogger.js:466
if (!requestError && body && body.code.toString() !== "0") {
^
TypeError: Cannot read property 'toString' of undefined
at Request._callback (/home/adinglasan/Desktop/splunk/node_modules/splunk-logging/splunklogger.js:466:55)