Utility to push Webtask logs from Auth0 Actions to splunk
#### Version 0.11.0
npm install --save bunyan).First, update npm to the latest version by running: sudo npm install npm -g.
Then run: npm install --save webtask-splunk-logger.
using Yarn: yarn add webtask-splunk-logger
``javascript
const createLogger = require("webtask-splunk-logger")
const SplunkToken = event.secrets.SplunkToken;
const SplunkUrl = event.secrets.SplunkUrl;
const SplunkIndex = event.secrets.SplunkIndex;
const ClientDomain= event.secrets.ClientDomain
if (!["SplunkIndex", "SplunkToken", "SplunkUrl"].every(key => Object.keys(event.secrets).includes(key))) {
throw new Error("Missing splunk config in Action secrets");
}
const splunkLogger = createLogger(SplunkToken, SplunkUrl, SplunkIndex, ClientDomain)
splunkLogger.logger.info(splunkLogger.payload, {
// Message can be an object or string (optional)
message: "message",
// an error response, optional
err
});
``