Git Product home page Git Product logo

bro-clickhouse's Introduction

clickhouse stuff for bro

Description

Schemas for conn, dns, ssh, and sql are in schemas. These work but the enums may need updating over time

Some examples queries are in example_queries

import_any.py can be used to load logs into clickhouse. It has only been tested with the above schemas, but should work with all log types with little to no changes.

generate_schema.py can be used to work out the appropriate schema to use. Pipe uncompressed bro ASCII log output to it and it will output the appropriate schema for each field. More data is required in order to generate the correct enum definitions. This tool is slow and not perfect, but is still useful for coming up with a starting point.

Currently the scripts only work for bro ASCII logs, but a version that can import json logs would be easy to write.

Usage

If you have any alarms for .ru traffic, this will light it up, you can also use the docker image.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv E0C56BD4    # optional

sudo apt-add-repository "deb http://repo.yandex.ru/clickhouse/trusty stable main"
sudo apt-get update

sudo apt-get install clickhouse-server-common clickhouse-client -y

sudo service clickhouse-server start
clickhouse-client

Check clickhouse is listening on localhost:8123, this should return 1:

curl 'http://localhost:8123/?query=SELECT%201'

Import schemas:

cat schemas/dns.sql

copy/paste this SQL into the :) prompt/clickhouse client.

Import some data:

./import_any.py dns /nsm/bro/log/2017-10-10/dns*

Check how much space this takes up for one day:

du -h /var/lib/clickhouse/data/default --max-depth=1

Try out an example query from example_queries directory.

Import rest of your data:

./import_any.py dns /nsm/bro/log/20*/dns*

bro-clickhouse's People

Contributors

j-gras avatar justinazoff avatar nojeffrey avatar scottbelden avatar tsl-karlp avatar

Watchers

 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.