Skip to content

mbiczysko/kibana-sinatra

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kibana::Sinatra

Dependency Status Build Status Gem Version

This gem provides Kibana 3 inside a Sinatra app that you can include in any Rack based system, including Rails.

Installation

Add this line to your application's Gemfile:

gem 'kibana-sinatra'

And then execute:

$ bundle

Or install it yourself as:

$ gem install kibana-sinatra

Usage

Inside Rails

First you will need to configure Kibana's config.js file so that a web browser can find your elasticsearch cluster.

Create a new file in config/initializers and include the following code. Replace the strings with the location of your elasticsearch cluster and the kibana index. Note that both of these are optional.

module Kibana::Sinatra
  class Web
    def elasticsearch_url
      "http://\"+window.location.hostname+\":9200"
    end

    def kibana_index
      "kibana-int"
    end
  end
end

In your config/routes.rb file mount the Kibana::Sinatra::Web class to a route:

mount Kibana::Sinatra::Web => '/kibana', :trailing_slash => true

The trailing slash is important due to the way Kibana links to CSS & JS files.

Start your server and you should now be able to load /kibana/ and Kibana 3 should start up!

Launch as Rack app

First you will need to configure Kibana's config.js same as "Inside Rails".

And add config.ru on top of your directory.

require 'sinatra'
require 'kibana/sinatra/web'

# If you need to configure elasticsearch_url, put your configuration here just like the Rails example.

run Kibana::Sinatra::Web

At last, you need to just run rackup.

rackup

Versions

Kibana-sinatra's version number will match the upstream Kibana version number, plus an additional build number. For example:

Kibana-sinatra v.3.0.0.0 is equivalent to upstream Kibana v.3.0.0, and is our build 0.

We aim to keep in step with Kibana's released versions.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Contributors

Thanks for all the help to our awesome contributors!

About

Kibana 3 packaged up as a Sinatra app

Resources

License

Stars

Watchers

Forks

Packages

No packages published