Coder Social home page Coder Social logo

blashbrook / sils_elastic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from silsconsortium/sils_elastic

0.0 1.0 0.0 18 KB

Resources for using Elasticsearch, Logstash, Kibana with Polaris ILS

License: GNU General Public License v3.0

Python 100.00%

sils_elastic's Introduction

sils_elastic

Resources for visualizing ILS data using Elasticsearch, Logstash, Kibana

Installing

You can get a feel for installing the Elastic stack on a system by reading through Digital Ocean's community guides. Beware that the Digital Ocean guides walk you through installing an older version of ELK, you can install the latest by reading the official documentation if you wish.

For CentOS 7: https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elk-stack-on-centos-7

For Ubuntu 16.04: https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elk-stack-on-ubuntu-16-04

There's also the offical documentation, which is excellent, for all three found here: https://www.elastic.co/guide/index.html

Getting Started / Backfilling a large historic ILS dataset into Elasticsearch

To get started you probably have a SQL query that returns interesting timestamped data, like checkouts. Since this data can go back years and years there can be gigabytes of data returned, so it's easiest to just chunk the results of a large historic query into a set of files and then read those files into Elasticsearch using Logstash's file input plugin. This is what is done in the example logstash config included here.

You can start with as much or as little data as you want, this is determined by how many rows are returned by your SQL query. The file chunker just formats each row returned as JSON, and writes one row per line, 100,000 rows per file. You could start with a SQL query that returns one month of data to get started.

The file chunker only knows how to connect to MSSQL databases, so if you aren't using Polaris, you'll need to modify it to connect to whatever type of database you're using. The connection information is stored in environment variables in the script.

Running logstash with the example config

The example configuration included here uses the input plugin to look for the files outpt by the file chunker, just set the path where it should look for the files. There are two important column names returned by the SQL query that are used here, transactiondate and transactionid, the first is the timestamp of the transaction and the second is the unique database ID. You'll have to change these if you used different column names in your SQL query for these fields. You'll also need to set the correct address of your Elasticsearch server.

You can run Logstash using the specified config with:

logstash -f logstash_config_build_from_files.conf

sils_elastic's People

Contributors

scottsils avatar silsconsortium avatar

Watchers

 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.