0.5.0 • Published 7 days ago

pino-splunk v0.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 days ago

pino-splunk

Load pino logs into Splunk.

The logs are sent in batches to reduce the load. The batch

Install

# npm
npm i pino-splunk

# yarn
yarn add pino-splunk

# pnpm
pnpm i pino-splunk

Usage

import pino from 'pino';

const splunkTransport = pino.transport({
  target: 'pino-splunk',
  options: {
    // These parameters are required
    url: 'https://mysplunkserver.example.com:8088',
    token: 'my-token',
    source: 'my-app-name',
    index: 'stage',

    // Optional parameters, default values listed
    // Batching - Flushes the logs after given number of log events
    flushSize: 10,
    // Batching - Flushes the if the specified number of milliseconds has passed since the last log event
    flushIntervalMs: 10000, // 10 seconds
    // URL path for the Splunk instance
    path: '/services/collector/event',
  },
});

const logger = pino({ level: 'info' }, splunkTransport);
0.5.0

7 days ago

0.4.1

1 year ago

0.4.0

1 year ago

0.3.0

2 years ago

0.2.0

3 years ago

0.1.0

3 years ago