Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
smxsm committed Nov 25, 2018
0 parents commit f2ff076
Show file tree
Hide file tree
Showing 21 changed files with 6,454 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.idea/
*.iml
*.ipr
*.iws
.classpath
.project
.settings/
target/
dependency-reduced-pom.xml
node_modules
node
build
cache
build.config.js.sample

27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
sudo: required
dist: trusty
language: java
jdk:
- oraclejdk8
addons:
apt:
packages:
- rpm
before_deploy:
- mvn jdeb:jdeb && export RELEASE_DEB_FILE=$(ls target/*.deb)
- mvn rpm:rpm && export RELEASE_RPM_FILE=$(find target/ -name '*.rpm' | tail -1)
- rm -f target/original-*.jar
- export RELEASE_PKG_FILE=$(ls target/*.jar)
- echo "Deploying release to GitHub releases"
deploy:
provider: releases
api_key:
secure: <enter your encrypted GitHub access token>
file:
- "${RELEASE_PKG_FILE}"
- "${RELEASE_DEB_FILE}"
- "${RELEASE_RPM_FILE}"
skip_cleanup: true
on:
tags: true
jdk: oraclejdk8
26 changes: 26 additions & 0 deletions GETTING-STARTED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Getting started with your new Graylog plugin
============================================

Welcome to your new Graylog plugin!

Please refer to http://docs.graylog.org/en/latest/pages/plugins.html for documentation on how to write
plugins for Graylog.

Travis CI
---------

There is a `.travis.yml` template in this project which is prepared to automatically
deploy the plugin artifacts (JAR, DEB, RPM) to GitHub releases.

You just have to add your encrypted GitHub access token to the `.travis.yml`.
The token can be generated in your [GitHub personal access token settings](https://github.com/settings/tokens).

Before Travis CI works, you have to enable it. Install the Travis CI command line
application and execute `travis enable`.

To encrypt your GitHub access token you can use `travis encrypt`.

Alternatively you can use `travis setup -f releases` to automatically create a GitHub
access token and add it to the `.travis.yml` file. **Attention:** doing this
will replace some parts of the `.travis.yml` file and you have to restore previous
settings.
Binary file added JRP_Input.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 changes: 87 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# JSON Remote Polling Input Plugin for Graylog

<!-- [![Build Status](https://travis-ci.org/https://github.com/smxsm/graylog-json-remote-poll.svg?branch=master)](https://travis-ci.org/https://github.com/smxsm/graylog-json-remote-poll) -->

This is a Graylog Input plugin that enables you to poll remote URIs which should return single GELF messages as JSON output.
It supports Basic Auth and Proxies.
All the fields in the message will be stored, here is an example message which contains some MySQL status info:

```json
{
"version": "1.0",
"host": "mydomain",
"short_message": "MySQL Status",
"timestamp": 1543155515,
"level": 1,
"_Aborted_clients_per_second": 0,
"_Aborted_connects_per_second": 0,
"_Com_admin_commands_per_second": 0,
"_Com_change_db_per_second": 0,
"_Com_commit_per_second": 0,
"_Com_delete_per_second": 0,
"_Com_delete_multi_per_second": 0,
"_Com_insert_per_second": 0,
"_Com_insert_select_per_second": 0,
"_Com_replace_per_second": 0,
"_Com_select_per_second": 0,
"_Com_set_option_per_second": 0,
"_Com_show_collations_per_second": 0,
"_Com_update_per_second": 0,
"_Connections_per_second": 0,
"_Created_tmp_disk_tables_per_second": 0,
"_Created_tmp_files_per_second": 0,
"_Created_tmp_tables_per_second": 0,
"_Delayed_errors_per_second": 0,
"_Delayed_insert_threads_per_second": 0,
"_Delayed_writes_per_second": 0,
"_Slow_queries_per_second": 0,
"_Table_locks_immediate_per_second": 0,
"_Table_locks_waited_per_second": 0,
"_Innodb_buffer_pool_read_requests": 4319683,
"_Innodb_buffer_pool_reads": 1163,
"_Innodb_buffer_pool_write_requests": 133618,
"_Max_used_connections": 23,
"_Open_files": 2,
"_Open_streams": 0,
"_Open_table_definitions": 291,
"_Open_tables": 416,
"_Qcache_free_blocks": 1,
"_Qcache_free_memory": 16760152,
"_Threads_cached": 7,
"_Threads_connected": 3,
"_Threads_created": 82,
"_Threads_running": 1
}
```

**Required Graylog version:** 2.0 and later

Installation
------------

[Download the plugin](https://github.com/https://github.com/smxsm/graylog-json-remote-poll/releases)
and place the `.jar` file in your Graylog plugin directory. The plugin directory
is the `plugins/` folder relative from your `graylog-server` directory by default
and can be configured in your `graylog.conf` file.

Restart `graylog-server` and you are done.

Usage
-----

After the plugin is installed, go to "System / Inputs" and launch a new _"JSON Remote Polling"_ input.
Enter the URL, set timeout, username, password etc. fields and start the input.

![JRP Input](JRP_Input.png)

Getting started
---------------

This project is using Maven 3 and requires Java 8 or higher.

* Clone this repository.
* Run `mvn package` to build a JAR file.
* Optional: Run `mvn jdeb:jdeb` and `mvn rpm:rpm` to create a DEB and RPM package respectively.
* Copy generated JAR file in target directory to your Graylog plugin directory.
* Restart the Graylog.

6 changes: 6 additions & 0 deletions build.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const path = require('path');

module.exports = {
// Make sure that this is the correct path to the web interface part of the Graylog server repository.
web_src_path: path.resolve(__dirname, '../graylog2-server', 'graylog2-web-interface'),
};
28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "JsonRemotePoll",
"version": "1.0.0-SNAPSHOT",
"description": "",
"repository": {
"type": "git",
"url": "https://github.com/smxsm/graylog-json-remote-poll"
},
"scripts": {
"build": "webpack",
"lint": "eslint -c .eslintrc src/**/*",
"test": "jest"
},
"keywords": [
"graylog",
"JSON",
"Polling",
"HTTP",
"Input"
],
"author": "Stefan Moises <moises@shoptimax.de>",
"license": "MIT",
"dependencies": {
},
"devDependencies": {
"graylog-web-plugin": "file:../graylog2-server/graylog2-web-interface/packages/graylog-web-plugin"
}
}
Loading

0 comments on commit f2ff076

Please sign in to comment.