NZBGet ElasticSearch Plugin

I wrote a simple plugin for NZBGet that inserts download history into an ElasticSearch cluster (or node). It uses API calls rather than parsing filesystem logs. I wanted a quick way to just insert the data so I created this script.

Simply copy the ESLog.py script into your NZBGet/scripts directory. In NZBGet, select settings and set the hostname of your ElasticSearch instance.

You can download the plugin on github

This Plugin for NZBGet inserts a record into a user specified ElasticSearch database. It only requires 2 configuration options:

  • the hostname of the elasticsearch instance
  • the port of the elasticsearch instance

This script is written in python and it requires the installation of the elasticsearch module: pip install elasticsearch

The purpose of this script is to allow you to create a dashboard or other reporting around your downloads. Using Grafana or the Kibana dashboard you can create neat visualizations.

Here’s a very simple example:
Simple Kibana Visualization
Simple Kibana Search

Fell free to create a Pull Request (PR) and submit improvements. I’m new to Python and there are a lot of areas for improvement in this plugin.

Installation:

Download and copy the ESLog.py file from this repo into your NZBGet/scripts directory. Alternatively, you can clone this repo directly into the /scripts/ directory:

1
2
3
4
# This directory will be where YOUR NZBGet installation is
cd /opt/nzbget/scripts
git clone https://github.com/chrisbergeron/nzbget-elasticsearch.git
mv nzbget-elasticsearch/ESLog.py .

Usage:

In NZBGet go into Settings and at the bottom left you should see ESLOG:
Configuring Plugin

Add the hostname of your ElasticSearch instance (not Kibana or Logstash) and the Port number it’s listening on (default is 9200).

If configured properly, you’ll see lines like this in your NZBGet Messages:
Sample Log Output

Roadmap:

  • Separate Show Name, Episode Name, Season and Episode info, Quality and Crew into separate index fields in Elastic.
  • Add case statement to parse and map NZBGet output codes into disposition names

Technology Used:
ElasticSearchNZBGetKibana
Comments