Git Product home page Git Product logo

from-kibana-to-pdf's Introduction

Export Kibana dashboard to PDF

How to convert Kibana dashboard to PDF using wkhtmltopdf, tested on a Docker container Debian GNU/Linux 8 (jessie).

Imgur


Table of contents


Requirements


Install wkhtmltopdf

$ # install required packages
$ apt-get update
$ apt-get install libxrender1 libxrender-dev libfontconfig1 libfontconfig1-dev

$ # download wkhtmltopdf
$ cd /opt/
$ wget "https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz"
$ tar xvfJ wkhtmltox-0.12.4_linux-generic-amd64.tar.xz

From Kibana

Select your Kibana dashboard and click on Share -> Copy embedded iframe Imgur


In your clipboard you'll have the iframe syntax, something like this:

<iframe src="https://10.19.19.1:5601/app/kibana#/dashboard/..." height="600" width="800"></iframe>

To PDF

Now, we need to create an HTML page in which including the Kibana iframe and then parse it with wkhtmltopdf. Is important to edit the iframe syntax including a static with, a static height and removing the iframe border. For example: <iframe style="border:none; width:1200px; height:800px;" .... Go to your web server root directory and create a kibana.html like this:

$ cd /var/www/html
$ nano -w kibana.html
<!DOCTYPE html>
<html lang="en">
<head>
   <title>Kibana</title>
</head>
<body>

   <!-- PASTE KIBANA IFRAME HERE --> 
   <iframe style="border:none; width:1200px; height:800px;" src="https://10.19.19.1:5601/app/kibana#/dashboard/..."></iframe>
   <!-- PASTE KIBANA IFRAME HERE -->
   
</body>
</html>

Run wkhtmltopdf

$ cd /var/www/html
$ /opt/wkhtmltox/bin/wkhtmltopdf --javascript-delay 10000 "http://127.0.0.1/kibana.html" ./kibana_dashboard.pdf

Now you can download your PDF from http://127.0.0.1/kibana_dashboard.pdf


Hope this can help :bowtie:

by theMiddle
https://secthemall.com
https://github.com/SECTHEMALL

from-kibana-to-pdf's People

Contributors

themiddleblue avatar

Watchers

James Cloos 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.