logstash-output-seq 0.0.1 → 0.0.3.pre.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/DEVELOPING.md +69 -0
- data/README.md +13 -71
- data/lib/logstash/outputs/seq.rb +3 -2
- data/lib/version-info.rb +7 -0
- data/logstash-output-seq.gemspec +31 -20
- data/spec/outputs/seq_spec.rb +4 -3
- data/spec/spec_helper.rb +4 -0
- metadata +87 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb7b2933ecba5476a1a8449dc3c39bea6a9f7be7
|
4
|
+
data.tar.gz: ee7ca93235178e3f2c7596c4b783a4542053f23b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c022cb3868a4840e205c584d1bfdf14c0e23f39496e99d2fcb17489ca7bc54c5a5d9c7fa8d875666f00ead09a49008138624118f5fcf8db21c9ef1ecc895da6
|
7
|
+
data.tar.gz: 2ac79b1772ce6500e711cc0b73c5cb11986414d50bccce320ef90b934000a59b721e52ddaf67ae4aed7376104dc9f6094e0a0fde87d47a6a5cc4d6902b6ea492
|
data/DEVELOPING.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
## Developing
|
2
|
+
|
3
|
+
### 1. Plugin Developement and Testing
|
4
|
+
|
5
|
+
#### Code
|
6
|
+
- To get started, you'll need JRuby with the Bundler gem installed.
|
7
|
+
|
8
|
+
- Create a new plugin or clone and existing from the GitHub [logstash-plugins](https://github.com/logstash-plugins) organization. We also provide [example plugins](https://github.com/logstash-plugins?query=example).
|
9
|
+
|
10
|
+
- Install dependencies
|
11
|
+
```sh
|
12
|
+
bundle install
|
13
|
+
```
|
14
|
+
|
15
|
+
#### Test
|
16
|
+
|
17
|
+
- Update your dependencies
|
18
|
+
|
19
|
+
```sh
|
20
|
+
bundle install
|
21
|
+
```
|
22
|
+
|
23
|
+
- Run tests
|
24
|
+
|
25
|
+
```sh
|
26
|
+
bundle exec rspec
|
27
|
+
```
|
28
|
+
|
29
|
+
### 2. Running your unpublished Plugin in Logstash
|
30
|
+
|
31
|
+
#### 2.1 Run in a local Logstash clone
|
32
|
+
|
33
|
+
- Edit Logstash `Gemfile` and add the local plugin path, for example:
|
34
|
+
```ruby
|
35
|
+
gem "logstash-output-seq", :path => "/your/local/logstash-output-seq"
|
36
|
+
```
|
37
|
+
- Install plugin
|
38
|
+
```sh
|
39
|
+
# Logstash 2.3 and higher
|
40
|
+
bin/logstash-plugin install --no-verify
|
41
|
+
|
42
|
+
# Prior to Logstash 2.3
|
43
|
+
bin/plugin install --no-verify
|
44
|
+
|
45
|
+
```
|
46
|
+
- Run Logstash with your plugin
|
47
|
+
```sh
|
48
|
+
bin/logstash -e 'output {seq {}}'
|
49
|
+
```
|
50
|
+
At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
|
51
|
+
|
52
|
+
#### 2.2 Run in an installed Logstash
|
53
|
+
|
54
|
+
You can use the same **2.1** method to run your plugin in an installed Logstash by editing its `Gemfile` and pointing the `:path` to your local plugin development directory or you can build the gem and install it using:
|
55
|
+
|
56
|
+
- Build your plugin gem
|
57
|
+
```sh
|
58
|
+
gem build logstash-output-seq.gemspec
|
59
|
+
```
|
60
|
+
- Install the plugin from the Logstash home
|
61
|
+
```sh
|
62
|
+
# Logstash 2.3 and higher
|
63
|
+
bin/logstash-plugin install --no-verify
|
64
|
+
|
65
|
+
# Prior to Logstash 2.3
|
66
|
+
bin/plugin install --no-verify
|
67
|
+
|
68
|
+
```
|
69
|
+
- Start Logstash and proceed to test the plugin
|
data/README.md
CHANGED
@@ -1,89 +1,31 @@
|
|
1
|
-
# Seq Logstash
|
1
|
+
# Seq output plugin for Logstash
|
2
2
|
|
3
3
|
[![Travis Build Status](https://travis-ci.org/tintoy/logstash-output-seq.svg)](https://travis-ci.org/tintoy/logstash-output-seq)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/logstash-output-seq.svg)](https://badge.fury.io/rb/logstash-output-seq)
|
5
|
+
[![Coverage Status (master)](https://coveralls.io/repos/github/tintoy/logstash-output-seq/badge.svg?branch=master)](https://coveralls.io/github/tintoy/logstash-output-seq?branch=master)
|
4
6
|
|
5
|
-
This is
|
7
|
+
This is an output plugin for [Logstash](https://github.com/elastic/logstash) that publishes events to [Seq](https://getseq.net/).
|
6
8
|
|
7
9
|
It is fully free and fully open source. The license is MIT, meaning you are pretty much free to use it however you want in whatever way.
|
8
10
|
|
9
|
-
|
11
|
+
## Usage
|
10
12
|
|
11
|
-
|
13
|
+
To install the Seq output plugin for Logstash:
|
12
14
|
|
13
|
-
Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elastic.co/guide/en/logstash/current/).
|
14
|
-
|
15
|
-
- For formatting code or config example, you can use the asciidoc `[source,ruby]` directive
|
16
|
-
- For more asciidoc formatting tips, see the excellent reference here https://github.com/elastic/docs#asciidoc-guide
|
17
|
-
|
18
|
-
## Developing
|
19
|
-
|
20
|
-
### 1. Plugin Developement and Testing
|
21
|
-
|
22
|
-
#### Code
|
23
|
-
- To get started, you'll need JRuby with the Bundler gem installed.
|
24
|
-
|
25
|
-
- Create a new plugin or clone and existing from the GitHub [logstash-plugins](https://github.com/logstash-plugins) organization. We also provide [example plugins](https://github.com/logstash-plugins?query=example).
|
26
|
-
|
27
|
-
- Install dependencies
|
28
|
-
```sh
|
29
|
-
bundle install
|
30
|
-
```
|
31
|
-
|
32
|
-
#### Test
|
33
|
-
|
34
|
-
- Update your dependencies
|
35
|
-
|
36
|
-
```sh
|
37
|
-
bundle install
|
38
|
-
```
|
39
|
-
|
40
|
-
- Run tests
|
41
|
-
|
42
|
-
```sh
|
43
|
-
bundle exec rspec
|
44
|
-
```
|
45
|
-
|
46
|
-
### 2. Running your unpublished Plugin in Logstash
|
47
|
-
|
48
|
-
#### 2.1 Run in a local Logstash clone
|
49
|
-
|
50
|
-
- Edit Logstash `Gemfile` and add the local plugin path, for example:
|
51
|
-
```ruby
|
52
|
-
gem "logstash-output-seq", :path => "/your/local/logstash-output-seq"
|
53
|
-
```
|
54
|
-
- Install plugin
|
55
15
|
```sh
|
56
16
|
# Logstash 2.3 and higher
|
57
|
-
bin/logstash-plugin install
|
58
|
-
|
59
|
-
# Prior to Logstash 2.3
|
60
|
-
bin/plugin install --no-verify
|
61
|
-
|
62
|
-
```
|
63
|
-
- Run Logstash with your plugin
|
64
|
-
```sh
|
65
|
-
bin/logstash -e 'output {seq {}}'
|
17
|
+
${LOGSTASH_HOME}/bin/logstash-plugin install logstash-output-seq
|
66
18
|
```
|
67
|
-
At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
|
68
|
-
|
69
|
-
#### 2.2 Run in an installed Logstash
|
70
19
|
|
71
|
-
|
20
|
+
The plugin has the following configuration options:
|
72
21
|
|
73
|
-
-
|
74
|
-
|
75
|
-
|
76
|
-
```
|
77
|
-
- Install the plugin from the Logstash home
|
78
|
-
```sh
|
79
|
-
# Logstash 2.3 and higher
|
80
|
-
bin/logstash-plugin install --no-verify
|
22
|
+
* `url` (Required) - The Seq server URL (e.g. `http://localhost:5341/`)
|
23
|
+
* `api_key` (Optional) - The Seq API key (if any) to use for authentication.
|
24
|
+
* Any parameters from the Logstash HttpClient mix-in (e.g. configuring SSL behaviour, etc).
|
81
25
|
|
82
|
-
|
83
|
-
bin/plugin install --no-verify
|
26
|
+
## Developing
|
84
27
|
|
85
|
-
|
86
|
-
- Start Logstash and proceed to test the plugin
|
28
|
+
[Developing](DEVELOPING.md)
|
87
29
|
|
88
30
|
## Contributing
|
89
31
|
|
data/lib/logstash/outputs/seq.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require 'json/ext'
|
3
2
|
require 'logstash/outputs/base'
|
4
3
|
require 'logstash/plugin_mixins/http_client'
|
5
4
|
require 'logstash/json'
|
6
5
|
require 'logstash/namespace'
|
7
6
|
|
7
|
+
require 'jrjackson'
|
8
|
+
|
8
9
|
# An output that sends events to Seq.
|
9
10
|
class LogStash::Outputs::Seq < LogStash::Outputs::Base
|
10
11
|
include LogStash::PluginMixins::HttpClient
|
@@ -70,7 +71,7 @@ class LogStash::Outputs::Seq < LogStash::Outputs::Base
|
|
70
71
|
|
71
72
|
request = client.post(@url, {
|
72
73
|
headers: @default_headers,
|
73
|
-
body: payload
|
74
|
+
body: JrJackson::Json.dump(payload),
|
74
75
|
async: true
|
75
76
|
})
|
76
77
|
|
data/lib/version-info.rb
ADDED
data/logstash-output-seq.gemspec
CHANGED
@@ -1,28 +1,39 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
require 'version-info'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'logstash-output-seq'
|
9
|
+
spec.version = LogStash::Output::Seq::VERSION
|
10
|
+
spec.licenses = ["MIT"]
|
11
|
+
spec.summary = "This plugin outputs log entries to Seq (https://getseq.net)."
|
12
|
+
spec.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install logstash-output-seq. This gem is not a stand-alone program"
|
13
|
+
spec.authors = ["tintoy"]
|
14
|
+
spec.email = "tintoy@tintoy.io"
|
15
|
+
spec.homepage = "https://github.com/tintoy/logstash-output-seq"
|
16
|
+
spec.require_paths = ["lib"]
|
11
17
|
|
12
18
|
# Files
|
13
|
-
|
19
|
+
spec.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE']
|
14
20
|
# Tests
|
15
|
-
|
21
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
16
22
|
|
17
23
|
# Special flag to let us know this is actually a logstash plugin
|
18
|
-
|
24
|
+
spec.metadata = { "logstash_plugin" => "true", "logstash_group" => "output" }
|
19
25
|
|
20
26
|
# Gem dependencies
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
27
|
+
spec.add_runtime_dependency "logstash-core", ">= 2.3.4", "< 3.0.0"
|
28
|
+
spec.add_runtime_dependency "logstash-mixin-http_client", ">= 2.2.4", "< 3.0.0"
|
29
|
+
spec.add_runtime_dependency "logstash-codec-plain"
|
30
|
+
|
31
|
+
spec.add_development_dependency "coveralls", "~> 0.8"
|
32
|
+
spec.add_development_dependency "bundler", "~> 1.12"
|
33
|
+
spec.add_development_dependency "logstash-devutils", "~> 0.0.15"
|
34
|
+
spec.add_development_dependency "pry", "~> 0.10"
|
35
|
+
spec.add_development_dependency "rake", "~> 11.2"
|
36
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
37
|
+
spec.add_development_dependency "sinatra", "~> 1.4"
|
38
|
+
spec.add_development_dependency "webrick", "~> 1.3"
|
28
39
|
end
|
data/spec/outputs/seq_spec.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require 'logstash/devutils/rspec/spec_helper'
|
3
|
-
require 'logstash/outputs/seq'
|
4
3
|
require 'logstash/codecs/plain'
|
5
4
|
require 'logstash/event'
|
6
5
|
|
7
|
-
require "
|
6
|
+
require "jrjackson"
|
8
7
|
require "sinatra"
|
9
8
|
|
9
|
+
require "spec/spec_helper"
|
10
|
+
|
10
11
|
describe LogStash::Outputs::Seq do
|
11
12
|
# Output and its configuration
|
12
13
|
let(:port) { PORT }
|
@@ -23,7 +24,7 @@ describe LogStash::Outputs::Seq do
|
|
23
24
|
let(:last_request) { TestApp.last_request }
|
24
25
|
let(:request_body) { last_request.body.read }
|
25
26
|
let(:request_content_type) { last_request ? last_request.env["CONTENT_TYPE"] : nil }
|
26
|
-
let(:posted_events) {
|
27
|
+
let(:posted_events) { JrJackson::Json.parse(request_body) }
|
27
28
|
|
28
29
|
# Sample events
|
29
30
|
let(:sample_event) {
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-seq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3.pre.alpha1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tintoy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -64,6 +64,34 @@ dependencies:
|
|
64
64
|
- - ">="
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '0'
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
requirement: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - "~>"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0.8'
|
73
|
+
name: coveralls
|
74
|
+
prerelease: false
|
75
|
+
type: :development
|
76
|
+
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - "~>"
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0.8'
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
requirement: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - "~>"
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '1.12'
|
87
|
+
name: bundler
|
88
|
+
prerelease: false
|
89
|
+
type: :development
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - "~>"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '1.12'
|
67
95
|
- !ruby/object:Gem::Dependency
|
68
96
|
requirement: !ruby/object:Gem::Requirement
|
69
97
|
requirements:
|
@@ -81,32 +109,74 @@ dependencies:
|
|
81
109
|
- !ruby/object:Gem::Dependency
|
82
110
|
requirement: !ruby/object:Gem::Requirement
|
83
111
|
requirements:
|
84
|
-
- - "
|
112
|
+
- - "~>"
|
85
113
|
- !ruby/object:Gem::Version
|
86
|
-
version: '0'
|
114
|
+
version: '0.10'
|
115
|
+
name: pry
|
116
|
+
prerelease: false
|
117
|
+
type: :development
|
118
|
+
version_requirements: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - "~>"
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0.10'
|
123
|
+
- !ruby/object:Gem::Dependency
|
124
|
+
requirement: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - "~>"
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '11.2'
|
129
|
+
name: rake
|
130
|
+
prerelease: false
|
131
|
+
type: :development
|
132
|
+
version_requirements: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - "~>"
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '11.2'
|
137
|
+
- !ruby/object:Gem::Dependency
|
138
|
+
requirement: !ruby/object:Gem::Requirement
|
139
|
+
requirements:
|
140
|
+
- - "~>"
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '3.0'
|
143
|
+
name: rspec
|
144
|
+
prerelease: false
|
145
|
+
type: :development
|
146
|
+
version_requirements: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - "~>"
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '3.0'
|
151
|
+
- !ruby/object:Gem::Dependency
|
152
|
+
requirement: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- - "~>"
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: '1.4'
|
87
157
|
name: sinatra
|
88
158
|
prerelease: false
|
89
159
|
type: :development
|
90
160
|
version_requirements: !ruby/object:Gem::Requirement
|
91
161
|
requirements:
|
92
|
-
- - "
|
162
|
+
- - "~>"
|
93
163
|
- !ruby/object:Gem::Version
|
94
|
-
version: '
|
164
|
+
version: '1.4'
|
95
165
|
- !ruby/object:Gem::Dependency
|
96
166
|
requirement: !ruby/object:Gem::Requirement
|
97
167
|
requirements:
|
98
|
-
- - "
|
168
|
+
- - "~>"
|
99
169
|
- !ruby/object:Gem::Version
|
100
|
-
version: '
|
170
|
+
version: '1.3'
|
101
171
|
name: webrick
|
102
172
|
prerelease: false
|
103
173
|
type: :development
|
104
174
|
version_requirements: !ruby/object:Gem::Requirement
|
105
175
|
requirements:
|
106
|
-
- - "
|
176
|
+
- - "~>"
|
107
177
|
- !ruby/object:Gem::Version
|
108
|
-
version: '
|
109
|
-
description: This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install
|
178
|
+
version: '1.3'
|
179
|
+
description: This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install logstash-output-seq. This gem is not a stand-alone program
|
110
180
|
email: tintoy@tintoy.io
|
111
181
|
executables: []
|
112
182
|
extensions: []
|
@@ -115,12 +185,15 @@ files:
|
|
115
185
|
- CHANGELOG.md
|
116
186
|
- CONTRIBUTORS
|
117
187
|
- DEVELOPER.md
|
188
|
+
- DEVELOPING.md
|
118
189
|
- Gemfile
|
119
190
|
- LICENSE
|
120
191
|
- README.md
|
121
192
|
- lib/logstash/outputs/seq.rb
|
193
|
+
- lib/version-info.rb
|
122
194
|
- logstash-output-seq.gemspec
|
123
195
|
- spec/outputs/seq_spec.rb
|
196
|
+
- spec/spec_helper.rb
|
124
197
|
homepage: https://github.com/tintoy/logstash-output-seq
|
125
198
|
licenses:
|
126
199
|
- MIT
|
@@ -138,9 +211,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
211
|
version: '0'
|
139
212
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
213
|
requirements:
|
141
|
-
- - "
|
214
|
+
- - ">"
|
142
215
|
- !ruby/object:Gem::Version
|
143
|
-
version:
|
216
|
+
version: 1.3.1
|
144
217
|
requirements: []
|
145
218
|
rubyforge_project:
|
146
219
|
rubygems_version: 2.4.8
|
@@ -149,3 +222,4 @@ specification_version: 4
|
|
149
222
|
summary: This plugin outputs log entries to Seq (https://getseq.net).
|
150
223
|
test_files:
|
151
224
|
- spec/outputs/seq_spec.rb
|
225
|
+
- spec/spec_helper.rb
|