Git Product home page Git Product logo

lessbana's Introduction

CLI for LogStash indexes

Kibana is cool, but sometimes it is more handy to work with logs in console. For this cases, no more pain with direct file browsing -- you can still use centralized log storage in ElasticSearch and use CLI tools for processing them, just use lessbana!

Look, examples!

(.venv)chemikadze ~/programming/lessbana $ lessbana show /all.log
2016-05-14T10:31:55.763Z test
2016-05-14T10:32:01.834Z test
2016-05-14T19:17:21.398Z hello
2016-05-14T19:17:39.293Z hello2
(.venv)chemikadze ~/programming/lessbana $ lessbana show --order desc /all.log
2016-05-14T19:17:39.293Z hello2
2016-05-14T19:17:21.398Z hello
2016-05-14T10:32:01.834Z test
2016-05-14T10:31:55.763Z test
(.venv)chemikadze ~/programming/lessbana $ lessbana show /all.log
2016-05-14T10:31:55.763Z test
2016-05-14T10:32:01.834Z test
2016-05-14T19:17:21.398Z hello
2016-05-14T19:17:39.293Z hello2
(.venv)chemikadze ~/programming/lessbana $ lessbana show /hosts/all.log
2016-05-14T10:31:55.763Z MacBook-Air-Nikolaj.local test
2016-05-14T10:32:01.834Z MacBook-Air-Nikolaj.local test
2016-05-14T19:17:21.398Z 1234 hello
2016-05-14T19:17:39.293Z 4321 hello2
(.venv)chemikadze ~/programming/lessbana $ lessbana show /hosts/1234
2016-05-14T19:17:21.398Z hello

And yes, it is configurable

Here is example config file:

# this is default values appied to for every pattern
default:
    elasticsearch_url: localhost
    index: logstash-*
    sort:
        "@timestamp": "asc"
    # lines are described as Jinja2 templates
    # __at_timestamp is metavar for @timestamp
    format: "{{ __at_timestamp }} {{ message }}"

patterns:

    # patterns can refer just to default value
    - /all.log:

    # or override individual fields
    - /hosts/all.log:
        format: "{{ __at_timestamp }} {{ host|default('unknown') }} {{ message }}"

    # and query part is recursive Jinja2 template where named captures are available
    - /hosts/(?P<host>.*):
        query:
            term:
                host: '{{ host }}'

lessbana's People

Contributors

chemikadze avatar

Stargazers

Hugo de Paix de Coeur avatar Lev avatar

Watchers

Anton Panasenko avatar 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.