Giter Site home page Giter Site logo

sematext / logagent-js Goto Github PK

View Code? Open in Web Editor NEW
390.0 23.0 79.0 5.38 MB

Extensible log shipper with input/output plugins, buffering, parsing, data masking, and small memory/CPU footprint

Home Page: https://sematext.com/logagent

License: Apache License 2.0

JavaScript 86.00% Shell 13.62% Dockerfile 0.26% Handlebars 0.12%
logs logging log-management logshipper elk elk-stack nodejs javascript logagent log-collector

logagent-js's Introduction

Build Status Deploy - read more

What is Logagent

Logagent is a modern, open-source, light-weight log shipper. It is like Filebeat and Logstash in one, without the JVM memory footprint. It comes with out of the box and extensible log parsing, on-disk buffering, secure transport, and bulk indexing to Elasticsearch, Sematext Logs, and other destinations. Its low memory footprint and low CPU overhead make it suitable for deploying on edge nodes and devices, while its ability to parse and structure logs makes it a great Logstash alternative.

Docker

Details about the the Logagent Docker image are described in the Docker Hub Readme

Installation

1) Install Node.js

Official Node.js downloads and instructions. E.g. for Debian/Ubuntu:

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
Install Logagent with npm
sudo npm i -g @sematext/logagent

2) Run logagent command line tool

logagent --help

3) Example: Index your log files in Elasticsearch

logagent -e http://localhost:9200 -i logs -g ‘/var/log/**/*.log’

4) Optional: Install service & config

Install service for Logagent using systemd, upstart, launchd To quickly create a config file for indexing into Elasticsearch without having to edit it run something like this:

sudo logagent-setup -u http://localhost:9200 -i INDEX_NAME -g '/var/log/**/*.log'
# Logsene US: use -u https://logsene-receiver.sematext.com and your Logsene App Token as index name.
# Logsene EU: use -u https://logsene-receiver.eu.sematext.com and your Logsene App Token as index name.

Configuration

To configure different inputs, different event processing, or different outputs (e.g. your own Elasticsearch) edit /etc/sematext/logagent.conf, e.g.:

output:
  logsene:
    module: elasticsearch
    url: http://elasticsearch-server:9200
    index: logs

Then restart the service with sudo service logagent restart. Troubleshooting & Logs Logagent’s own logs:

  • Upstart: /var/log/upstart/logagent.log
  • Systemd: journalctl -u logagent
  • Launchd: /Library/Logs/logagent.log

Location of service scripts:

  • Upstart: /etc/init/logagent.conf
  • Systemd: /etc/systemd/system/logagent.service
  • Launchd: /Library/LaunchDaemons/com.sematext.logagent.plist

Start/stop service:

  • Upstart: service logagent stop/start
  • Systemd: systemctl stop/start logagent
  • Launchd: launchctl start/stop com.sematext.logagent

Documentation & Support

Development

  • Update to the last node version
  • From root folder node type: node ./bin/logagent -h
  • To test from root folder type: node test

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.