Giter Club home page Giter Club logo

elk-box's Introduction

This will give you a basic and fully operational virtual machine running the Elastic Stack (ELK):

  • Debian 8 (Jessie).
  • Elasticsearch 5.0.0.
  • Logstash 5.0.0.
  • Kibana 5.0.0.

Tested under Windows 7, with VirtualBox 5.1.6 and Vagrant 1.8.6.

Install

  • First, you need to install VirtualBox and Vagrant.
  • Create a new directory under VirtualBox's Default Machine Folder, and put this repo's files inside.
  • [Optional] Edit ./Vagrantfile according to your needs (more memory, proxy settings, etc.).
  • Run $> vagrant up form inside the created directory using your command line tool (grab a coffee, that'll take a while).

The machine should now be up and running. You can access it via SSH ([email protected]:2222) using the private key located at ./.vagrant/machines/default/virtualbox/private_key.

  • In /etc/elasticsearch/elasticsearch.yml, set the following properties:
    • network.host: localhost
    • http.port: 9200
  • In /etc/kibana/kibana.yml, set the following properties:
    • server.port: 5601
    • server.host: "<GUEST_IP_ADDRESS>"
    • elasticsearch.url: "http://localhost:9200"
  • Restart Elasticsearch and Kibana (something like $> sudo /etc/init.d/elasticsearch restart or $> sudo systemctl restart kibana).

Make sure the stack is running smoothly:

  • Elasticsearch: $> curl http://localhost:9200

    {
        "name" : "cD69Sz0",
        "cluster_name" : "elasticsearch",
        "cluster_uuid" : "CBNeHXz4Q1C8SUNCnE5d6g",
        "version" : {
            "number" : "5.0.0",
            "build_hash" : "253032b",
            "build_date" : "2016-10-26T05:11:34.737Z",
            "build_snapshot" : false,
            "lucene_version" : "6.2.0"
        },
        "tagline" : "You Know, for Search"
    }
  • Kibana: http://localhost:5601

Logs are available in /var/log/.

At this point, you're set. The stack is installed, but not yet flowing (check out the example below for a complete workflow).

Example

Logstash is capable of fetching events from a wide range of sources. Let's try a simple case: reading entries from a local logfile (formatted with Monolog).

He're our file: $> more ~/sample.log

[2016-11-10 12:00:01] sample.INFO: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. [] []
[2016-11-10 12:15:02] sample.WARNING: Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. [] []
[2016-11-10 12:30:03] sample.INFO: Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. [] []

In order for Logstash to parse this file and structure it (but also to listen to any change that may occur on it), we must describe the complete pipeline in /etc/logstash/conf.d/sample.conf.

Restart Logstash, and then, on Kibana, create a new pattern to load our Elasticsearch index (logstash-sample). Finally, check out the Discovery section to see everything in place.

Screenshot

elk-box's People

Contributors

emxjay avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

nomagean

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.