You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

elasticsearch-transport

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elasticsearch-transport

Winston tranport to save logs in elasticsearch

0.0.3
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

elasticsearch-transport

A ElasticSearch transport for winston.

Motivation

A small library to enable send logs to elasticsearch to analyze logs and build dashboards in Grafana, Kibana or customized plataform.

Usage

import winston from 'winston'

import TransportElastic from 'elasticsearch-transport'

const logger = winston.createLogger({
  format: winston.format.combine(winston.format.timestamp(), winston.format.json(), winston.format.prettyPrint()),
  transports: [
    new winston.transports.Console()
    new TransportElastic({
            silent: false,
            elasticClient: {
                node: 'http://elasticsearch:9200',
                auth: {
                    username: 'elastic',
                    password: 'elastic',
                }
            }
        })
  ],
});

logger.info('saving log in elasticsearch!!');

The Elastic transport takes the following options. All options is required:

OptionDescription
silentREQUIRED. Enable or disable to save the log in elasticsearch
elasticClientREQUIRED. The options/credentials to connect in ElasticSearch

Installation

NPM

$ npm install winston elasticsearch-transport

Yarn

$ yarn add winston elasticsearch-transport

Made by Ramon Paolo Maram ❤

Keywords

transport-winston

FAQs

Package last updated on 26 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts