GithubHelp home page GithubHelp logo

mean-elk's Introduction

MEAN with FLEK

Welcome to Demo Application.

MEAN stack

The mean stack is intended to provide a simple and fun starting point for cloud native fullstack javascript applications.
MEAN is a set of Open Source components that together, provide an end-to-end framework for building dynamic web applications; starting from the top (code running in the browser) to the bottom (database). The stack is made up of:

  • MongoDB : Document database โ€“ used by your back-end application to store its data as JSON (JavaScript Object Notation) documents
  • Express (sometimes referred to as Express.js): Back-end web application framework running on top of Node.js
  • Angular (formerly Angular.js): Front-end web app framework; runs your JavaScript code in the user's browser, allowing your application UI to be dynamic
  • Node.js : JavaScript runtime environment โ€“ lets you implement your application back-end in JavaScript

FLEK stack

In order to monitor performance of your application or API, we will use FLEK stack for following

  • FileBeat : it will help to tail your log files without doing ssh to server
  • Logstash : it will help you to filter and parse the logs and transform them required format before loading it ES.
  • Elastic Search : it will help to store and query logs for debugging
  • Kibana : it will help you to understand your logs with better way than ever with help of beautiful Visualizations

Pre-requisites

Docker based

git clone https://gitlab.com/shaadi/hackfest2019/elasticstack-filebeat-demo
cd mean
cp .env.example .env
docker-compose up -d

Credits

  • The MEAN name was coined by Valeri Karpov.
  • Initial concept and development was done by Amos Haviv and sponsered by Linnovate.
  • Inspired by the great work of Madhusudhan Srinivasa.
  • elastic.co for 14 days free trial

About Demo

It is very basic web application, which can help us to understand how does FLEK stack works?

Here is workflow to follow

  1. Access a home page, 0.0.0.0:4040
  2. mean/server/config/log will hold maintain the access.log with help of morgan npm module
  3. Filebeat will keep harvesting the access.log file which holding a log lines in json format
  4. A mentioned in configuration file. logstash will decode json log lines and load it into the ES
  5. With help of Kibana, you can query and debug the log lines and you can also form the visualizations

Importance of the following files

  • dockerconf/Dockerfile : This file is responsible for main application which will be running on 0.0.0.0:4040
  • dockerconf/filebeat.yml : This file is responsible for configuration of filebeat. For current demo, we'll use it to define input style of logs and to mention logstash connection
  • dockerconf/logstash.conf : This file will hellp you to configure the logstash, in order to filter and transform the logs before loading it to elastic search.
  • dockerconf/docker-compose.yml : This is the composer file which will help you to configure your stack
  • dockerconf/logstash.yml : Need to explore!!!

What's remaining to cover?

  • How to collect docker container logs (using tags in filter) without breaking current working Application?
  • Clean up logs by setting up the clean up cron on application logs

Elastic.co settings sample

You need to update docker-compose.yml with proper ES config params.

![alt ESConfigSample][https://github.com/bkvaiude/mean-elk/blob/master/dockerconf/ESConfig.png]

mean-elk's People

Contributors

liorkesos avatar angular-cli avatar bkvaiude avatar feenr avatar snyk-bot avatar

Watchers

James Cloos avatar  avatar

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.