Git Product home page Git Product logo

pm2-elasticsearch-logger's Introduction

pm2-elasticsearch-logger

npm version dependencies Status Build Status XO code style License

Module that sends logs of processes controlled by PM2 to Elasticsearch πŸ“’πŸ”

Install

pm2 install pm2-elasticsearch-logger

Configuration

Set options with the command

pm2 set pm2-elasticsearch-logger:<option> <value>

PM2 will automatically restart the module after changing an option.

Options

option default
elasticUrl URL of Elasticsearch API http://localhost:9200
insecure allow https connections to servers with invalid certificate false
index Elasticsearch index to use pm2
type Document type to use pm2
host host attribute of the document os.hostname()

Todo, Ideas

  • Configurable document attributes
  • Create mapping for @timestamp only if neccessary, control by config option

Contributing

Pull Requests welcome!

License

MIT (c) 2019 Sebastian Raff

pm2-elasticsearch-logger's People

Contributors

hobbyquaker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pm2-elasticsearch-logger's Issues

Cannot create template and push new data in Elasticsearch 7.6.0

Hello @hobbyquaker Thank you for your module it's really help me.

The code need to update because after ElasticSearch version 7.x they remove mapping types.

So for pm2-elasticsearch-logger can work normally we need to

  1. Make mapping type to "_doc" because cannot support custom mapping type
  2. Update function createMapping because cannot create mapping for custom mapping type.

Thank you.

Timestamp recognized as long type in kibana

Hello, Sebastian, thank you for logger, very helpful module πŸ‘
Timestamp recognized as long type in Kibana, and there is an option to modify that?
Ubuntu 16.04 / Elasticsearch & Kibana 7.2 / PM2 3.5.1

{
  "mapping": {
    "properties": {
      "@timestamp": {
        "type": "long"
      },
      "host": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "id": {
        "type": "long"
      },
      "message": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "process": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "source": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      }
    }
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.