logstash-output-CiscoZeus 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 81ab38b656873f986e665b219a08401048f7c972
4
+ data.tar.gz: 1b519c9b95e089476c3820b98fadf32b89e799d5
5
+ SHA512:
6
+ metadata.gz: e2986ab1d7f36a4afb63a720cf8153c938c71b033f17d2302794107085eda211126045ee54ac93504cb23ceaad428a677b6243611b34cbd5a3e947d9244e10c5
7
+ data.tar.gz: 0076f27596900e74513f0c4305896294578261f26e8d22eb2c58245b7d2dc6ce26241ada7e7f063a47a1055bb645296d4153fb8fe7474a78c6890ab8265055a9
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,11 @@
1
+ Licensed under the Apache License, Version 2.0 (the "License");
2
+ you may not use this file except in compliance with the License.
3
+ You may obtain a copy of the License at
4
+
5
+ http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software
8
+ distributed under the License is distributed on an "AS IS" BASIS,
9
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ See the License for the specific language governing permissions and
11
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # Logstash Output Plugin to Cisco Zeus
2
+
3
+ This is a plugin for [Logstash](https://github.com/elastic/logstash).
4
+ It is a simple wrapper of the [Ruby Zeus Client](https://github.com/CiscoZeus/ruby-zeusclient).
5
+
6
+ ## Developing
7
+
8
+ First of all you'll need JRuby, since Logstash is written in ruby and runs on the JVM.
9
+ You can get it [in their website](http://jruby.org/download) or through [RVM](https://rvm.io/).
10
+
11
+ ### Building
12
+
13
+ ```sh
14
+ jruby -S bundle install
15
+ jruby -S gem build logstash-output-CiscoZeus.gemspec
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ### Installation
21
+
22
+ ```sh
23
+ logstash-plugin install logstash-output-CiscoZeus-0.1.0.gem
24
+ ```
25
+
26
+ ### Configuration
27
+
28
+ Add this configuration to the output section of your logstash configuration file.
29
+
30
+ ```
31
+ output {
32
+ CiscoZeus {
33
+ token => "my_token"
34
+ log_name => "my_desired_log_name"
35
+ endpoint => "myendpoint.ciscozeus.io"
36
+ }
37
+ }
38
+ ```
39
+
40
+ ## License and copyright
41
+
42
+ Copyright(C) 2017 - Cisco Systems, Inc.
43
+ Apache License, Version 2.0
44
+
@@ -0,0 +1,30 @@
1
+ # encoding: utf-8
2
+ require "logstash/outputs/base"
3
+ require "logstash/namespace"
4
+ require "logstash/json"
5
+ require 'zeus/api_client'
6
+
7
+ # Outputs events to CiscoZeus
8
+ class LogStash::Outputs::Ciscozeus < LogStash::Outputs::Base
9
+ config_name "CiscoZeus"
10
+
11
+ config :token, :validate => :string
12
+ config :endpoint, :validate => :string, :default => "data04.ciscozeus.io"
13
+ config :log_name, :validate => :string, :default => "logstash_data"
14
+
15
+ concurrency :single
16
+
17
+ def register
18
+ @zeus_client = Zeus::APIClient.new({
19
+ access_token: @token,
20
+ endpoint: @endpoint
21
+ })
22
+ end # def register
23
+
24
+ def multi_receive(events)
25
+ result = @zeus_client.send_logs(@log_name, events)
26
+ if not result.success?
27
+ STDERR.puts "Failed to send data to zeus: " + result.data.to_s
28
+ end
29
+ end # def receive
30
+ end # class LogStash::Outputs::Ciscozeus
@@ -0,0 +1,21 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'logstash-output-CiscoZeus'
3
+ s.version = '0.1.1'
4
+ s.licenses = ['Apache-2.0']
5
+ s.summary = 'Logstash plugin to talk with the CiscoZeus HTTP API'
6
+ s.homepage = 'http://ciscozeus.io'
7
+ s.authors = ['Yoel Cabo']
8
+ s.email = 'ycabolop@cisco.com'
9
+ s.require_paths = ['lib']
10
+
11
+ # Files
12
+ s.files = Dir['lib/**/*', 'vendor/**/*','*.gemspec','*.md','Gemfile','LICENSE']
13
+
14
+ # Special flag to let us know this is actually a logstash plugin
15
+ s.metadata = { "logstash_plugin" => "true", "logstash_group" => "output" }
16
+
17
+ # Gem dependencies
18
+ s.add_runtime_dependency "logstash-core", ">= 2.0.0", "< 3.0.0"
19
+ s.add_runtime_dependency "logstash-codec-plain"
20
+ s.add_runtime_dependency "zeusclient", "~> 0"
21
+ end
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: logstash-output-CiscoZeus
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Yoel Cabo
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-03-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: 2.0.0
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: 3.0.0
22
+ name: logstash-core
23
+ prerelease: false
24
+ type: :runtime
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 2.0.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 3.0.0
33
+ - !ruby/object:Gem::Dependency
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ name: logstash-codec-plain
40
+ prerelease: false
41
+ type: :runtime
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ requirement: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ name: zeusclient
54
+ prerelease: false
55
+ type: :runtime
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ description:
62
+ email: ycabolop@cisco.com
63
+ executables: []
64
+ extensions: []
65
+ extra_rdoc_files: []
66
+ files:
67
+ - Gemfile
68
+ - LICENSE
69
+ - README.md
70
+ - lib/logstash/outputs/CiscoZeus.rb
71
+ - logstash-output-CiscoZeus.gemspec
72
+ homepage: http://ciscozeus.io
73
+ licenses:
74
+ - Apache-2.0
75
+ metadata:
76
+ logstash_plugin: 'true'
77
+ logstash_group: output
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.6.8
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Logstash plugin to talk with the CiscoZeus HTTP API
98
+ test_files: []