winston-transport-splunk
A Splunk transport for winston.
Usage
;;cconst {const transports = ;//// Create console and other transports//transports;return transports;};const options =console:level:'debug'splunk:url: YOUR_SPLUNK_URLindex: YOUR_SPLUNK_INDEXtoken: YOUR_SPLUNK_TOKENhost: YOUR_SPLUNK_HOSTsource: YOUR_SPLUNK_SOURCEsourcetype:'api_json'maxRetries:0level:'debug'const createLogger = winston;
The Splunk transport is based on splunk-logging, and used winston-elasticsearch as a reference.
configuration options
- source: The value used for the "source" metadata passed to Splunk.
- sourcetype: The value used for the "sourcetype" metadata passed to Splunk.
- batchInterval: The number of milliseconds to wait before flushing logs.
- maxBatchCount: The number of logs to batch before flushing.
- maxBatchSize: The size of the batch, in bytes, to accumulate before flushing.
- maxRetries: The number of times the transport should retry sending failed batches.
- url: The url used to connect to the Splunk. This is required
- index: The Splunk index to log to.
- token: The token used for connecting to the Splunk. This is required
This module uses splunk-logging to send events to Splunk, more details of configuration options can be found at splunk-logging.
Installation
Installing winston-transport-splunk
$ npm install --save winston-transport-splunk
Run Linting
npm run lint
Run Tests
Tests will be added soon.
npm run test