Create Kibana plugins

Generate an example plugin

  1. Clone Kibana source code and select the version you want to use (in this case is v5.5.1):

    git clone https://github.com/elastic/kibana.git
    cd kibana/
    git checkout tags/v5.5.1
    
  2. Install dependencies:

    npm install
    
  3. You can generate an example plugin with kibana-template-plugin:

    npm install -g sao template-kibana-plugin
    cd my-plugin
    sao kibana-plugin
    
  4. Move the plugin into the Kibana’s plugins folder (kibana/plugins).
    Kibana will monitor this folder for changes and restart when necessary.
    Do not create symlinks, it will not work. If submit your code to Git, for example, you need to do it inside this folder:

    mv my-plugin kibana/plugins
    
  5. You need an elasticsearch instance already running. If you don’t have, you can do it easily with docker:

    docker run -p 9200:9200 -d elasticsearch
    
  6. Run Kibana and open http://localhost:5601

    cd kibana
    npm start
    

Further reading

https://www.timroes.de/2015/12/02/writing-kibana-4-plugins-basics/
https://www.timroes.de/2016/02/21/writing-kibana-plugins-custom-applications/

Plugin types

  • visTypes: add new visualization types to Kibana.
  • apps: Kibana has the possibility to add completely separated apps, that can offer new functionality. One famous example might be timelion, a time series composer for Kibana, which is an app inside of Kibana.
  • fieldFormats: Add new field formatters to Kibana
  • and several others

Important files

  • package.js (mandatory) - npm package definition
  • index.js (mandatory) - setups everything needed by the plugin
  • server/ - files used in the server side with implementations
  • public/ - files used by the browser/client side

Publish and install plugins

  • Publish: create a ZIP file containing the plugin
  • Install:

    bin/kibana plugin --install my-plugin -u https://url.to/plugin
    

    The URL can start with file://