All Projects → malike → elasticsearch-report-engine

malike / elasticsearch-report-engine

Licence: GPL-3.0 license
An Elasticsearch plugin to return query results as either PDF,HTML or CSV.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to elasticsearch-report-engine

Elasticsearch Dataformat
Excel/CSV/BulkJSON downloads on Elasticsearch.
Stars: ✭ 135 (+175.51%)
Mutual labels:  csv, elasticsearch-plugin
JasperReportsBoot
JasperReports font extensions and Spring Boot Sample
Stars: ✭ 18 (-63.27%)
Mutual labels:  jasperreports, pdf-generation
JasperViewerFX
The JasperViewerFX is a free JavaFX library which aims to avoid use of JasperReport's swing viewer
Stars: ✭ 27 (-44.9%)
Mutual labels:  jasperreports, pdf-generation
Docto
Simple command line utility for converting .doc & .xls files to any supported format such as Text, RTF, CSV or PDF
Stars: ✭ 220 (+348.98%)
Mutual labels:  csv, pdf-generation
csvlixir
A CSV reading/writing application for Elixir.
Stars: ✭ 32 (-34.69%)
Mutual labels:  csv
pandoc-placetable
Pandoc filter to include CSV data (from file or URL)
Stars: ✭ 35 (-28.57%)
Mutual labels:  csv
pdfconduit
Prepare documents for distribution
Stars: ✭ 22 (-55.1%)
Mutual labels:  pdf-generation
imprenta
An AWS lambda in python 3 that generates PDF files from HTML using jinja, pdfkit and wkhtmltopdf.
Stars: ✭ 18 (-63.27%)
Mutual labels:  pdf-generation
tv
📺(tv) Tidy Viewer is a cross-platform CLI csv pretty printer that uses column styling to maximize viewer enjoyment.
Stars: ✭ 1,763 (+3497.96%)
Mutual labels:  csv
pydf
PDF generation in python using wkhtmltopdf for heroku and docker
Stars: ✭ 68 (+38.78%)
Mutual labels:  pdf-generation
convey
CSV processing and web related data types mutual conversion
Stars: ✭ 16 (-67.35%)
Mutual labels:  csv
fastapi-csv
🏗️ Create APIs from CSV files within seconds, using fastapi
Stars: ✭ 46 (-6.12%)
Mutual labels:  csv
datasets
The primary repository for all of the CORGIS Datasets
Stars: ✭ 19 (-61.22%)
Mutual labels:  csv
pdftron-android-samples
PDFTron Android Samples
Stars: ✭ 30 (-38.78%)
Mutual labels:  pdf-generation
docraptor-ruby
A native Ruby client for the DocRaptor HTML to PDF generation API
Stars: ✭ 20 (-59.18%)
Mutual labels:  pdf-generation
ph-pdf-layout
Java library for creating fluid page layouts with Apache PDFBox. Supporting multi-page tables, different page layouts etc.
Stars: ✭ 33 (-32.65%)
Mutual labels:  pdf-generation
tabtools
🔧 SQL for csv file in UNIX command line with awk.
Stars: ✭ 16 (-67.35%)
Mutual labels:  csv
mdtable2csv
convert tables in .md to .csv
Stars: ✭ 91 (+85.71%)
Mutual labels:  csv
umdoc
A Markdown to LaTeX to PDF converter
Stars: ✭ 15 (-69.39%)
Mutual labels:  pdf-generation
Android-XML-to-PDF-Generator
This library is for convert XML to PDF very easily using Step Builders Pattern
Stars: ✭ 140 (+185.71%)
Mutual labels:  pdf-generation

Build Status Coverage Status

Plugin to generate Reports from Elasticsearch Queries.

Overview

Once this plugin is installed into elasticsearch search,it exposes the url http://{ip}:9200/_generate, you can run queries on your cluster with the right parameters it would return PDF,HTML or CSV file.


Install

1. Install plugin

sudo bin/elasticsearch-plugin install https://github.com/malike/elasticsearch-report-engine/releases/download/5.4.0/st.malike.elasticsearch.report.engine-5.4.0.zip

2. Grant permissions

Grant Access

3. Folder Structure

Create folders templates and reports in ES_HOME. Store your *.jasper and *.jrxml files in the templates folder and pass the templateName as the template (with the right extension) parameter for HTML and PDF reports.


Usage

PDF

1. PDF Report

The plugin uses Jasper Report as core engine for generating PDF reports. PDF templates can be designed using iReport Designer. This generates a jrmxl file. You can also use the compiled file with the extension jasper.

The plugin generates base64 encoded stream of the PDF report generated once you pass the name of the template file and the query to fetch data from Elasticsearch.

PDF Sample Request

  curl -H "Content-Type:application/json" -XPOST "http://localhost:9201/_generate"  -d '{"format":"PDF","fileName":"TEST_REPORT","index":"reportindex","template":"filename.jrxml","from":0,"size":10,"query":"{term:{description:Transaction}}"}'

Parameters



i. format : Format of Report [Required]
ii. index : Elasticsearch Index [Required]
iii. template : Jasper Report Template [Required]
iv. from : Offset for querying large data [Optional]
v. size : Size for querying large data [Optional]
iv. query : Query to search Elasticsearch index [Optional : Defaults to '*' if nothing is passed]
vi. fileName : File name [Optional]

Generate PDF Response

i. Success

{"status":true,
  "count":1,
  "data": "base 64 encoded string",
  "message":"SUCCESS"
  }

ii. Missing Required Param

  {"status":false,
   "count":0,
   "data": null,
   "message":"MISSING_PARAM"
   }

iii. Report Format Unknown

   {"status":false,
    "count":0,
    "data": null,
    "message":"REPORT_FORMAT_UNKNOWN"
   }

iii. System Error Generating Report

   {"status":false,
    "count":0,
    "data": null,
    "message":"ERROR_GENERATING_REPORT"
   }

Sample PDF

HTML

2. HTML Report

Just like the PDF report,the HTML also uses Jasper Report as core engine for generating reports.

HTML Reports provides an alternative for use cases where reports should not be sent as an attached file.

The generates base64 encoded stream of the HTML report generated. There's also an option to return the HTML string instead of the base64 encoded string. This requires passing returnAs:PLAIN as part of the request JSON.

HTML Sample Request

  curl -H "Content-Type:application/json" -XPOST "http://localhost:9201/_generate"  -d '{"format":"HTML","fileName":"TEST_REPORT","index":"reportindex","template":"filename.jrxml","from":0,"size":10,"query":"{term:{description:Transaction}}"}'

Parameters



i. format : Format of Report [Required]
ii. index : Elasticsearch Index [Required]
iii. template : Jasper Report Template [Required]
iv. from : Offset for querying large data [Optional]
v. size : Size for querying large data [Optional]
iv. query : Query to search Elasticsearch index [Optional : Defaults to '*' if nothing is passed]
vi. fileName : File name [Optional]
vii. returnAs : How you want HTML file returned. Possible values PLAIN and BASE64 [Optional : Defaults to BASE64]

Generate HTML Response

i. Success

 {"status":true,
  "count":1,
  "data": "base 64 encoded string",
  "message":"SUCCESS"
  }

ii. Missing Required Param

  {"status":false,
   "count":0,
   "data": null,
   "message":"MISSING_PARAM"
  }

iii. Report Format Unknown

 {"status":false,
  "count":0,
  "data": null,
  "message":"REPORT_FORMAT_UNKNOWN"
 }

iii. System Error Generating Report

   {"status":false,
    "count":0,
    "data": null,
    "message":"ERROR_GENERATING_REPORT"
   }

Sample HTML

*Note: For HTML reports you want returned as HTML string instead of a base64 encoded string. Send this parameter as part of your default parameters : "returnAs":"PLAIN

CSV

3. CSV Report

Unlike the PDF and HTML reports,the CSV option does not use Jasper Report as core engine for generating reports. Generating a CSV report uses the query and returns a base64 encoded of the file.

CSV Sample Request

    curl -H "Content-Type:application/json" -XPOST "http://localhost:9201/_generate"  -d '{"format":"CSV","fileName":"TEST_REPORT","index":"reportindex","from":0,"size":10,"query":"{term:{description:Transaction}}"}'

Parameters



i. format : Format of Report [Required]
ii. index : Elasticsearch Index [Required]
iii. returnAs : How you want CSV file returned. Possible values PLAIN and BASE64 [Optional : Defaults to BASE64]
iv. from : Offset for querying large data [Optional]
v. size : Size for querying large data [Optional]
iv. query : Query to search Elasticsearch index [Optional : Defaults to '*' if nothing is passed]
vi. fileName : File name [Optional]

CSV Sample Response

i. Success

 {"status":true,
  "count":1,
  "data": "base 64 encoded string",
  "message":"SUCCESS"
  }

ii. Missing Required Param

   {"status":false,
      "count":0,
      "data": null,
      "message":"MISSING_PARAM"
      }

iii. Report Format Unknown

   {"status":false,
      "count":0,
      "data": null,
      "message":"REPORT_FORMAT_UNKNOWN"
      }

iii. System Error Generating Report

   {"status":false,
      "count":0,
      "data": null,
      "message":"ERROR_GENERATING_REPORT"
      }

Sample CSV



*Note: For CSV reports you want returned as comma separated values instead of a base64 encoded string. Send this parameter as part of your default parameters : "returnAs":"PLAIN

 

 

Download

Elasticsearch versions supported by this plugin include :

Elasticsearch Version Report Plugin Version Comments
5.4.0 zip Tested
5.6.10 zip Tested

 

 

 

 

Scheduling

This plugin can work with an alerting system and a custom elasticsearch watcher to send emailed reports to specific contacts. By creating your watcher events in the custom elasticsearch watch, events would be pushed to Apache Kafka once there's a hit, go-kafka-alert listening on Apache Kafka for events would react by emailing embedded HTML reports or attached CSV or PDF reports.

This requires no updates to this plugin but setup and configurations in go-kafka-alert and elasticsearch watcher

Contribute

Contributions are always welcome! Please read the contribution guidelines first.

Code of Conduct

Please read this.

License

GNU General Public License v3.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].