logstash-input-google_pubsub 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7b261bb9333fce81b2dc53f8474d332a16de4519
4
- data.tar.gz: fee0a4acafa699ced1feb58cedfaeaea9bcd1fa8
2
+ SHA256:
3
+ metadata.gz: e41ed92888f32a05a1d12094c6ff419be0c6949f39b71c3c084f9b522eb463bb
4
+ data.tar.gz: 6ade48556636b5f2c845177bb1536cf537339ff8e8619b8fb6f912b202219078
5
5
  SHA512:
6
- metadata.gz: d54ac43c05cc10acce0a696e067a681bb1155ed3388f5f2b47d99e936c337259086eb32944793405e84163e71246b25eaf70e63aa8dab8b1ccd7c6b647044ff5
7
- data.tar.gz: e54671aae537ff2cd6176f4c38a61912ab0be6fdc2a3ad91d544eb375ecb3179b66a33344fe69744d29373b89e00a45a98f716645a913ac1e788126cc9d68b8e
6
+ metadata.gz: e16e74cef0eb0a49e04727c3bbdbae707e43a23de33cd16fafa3fee3edf77853d1730fa8818b3ba73df7e73030b7122676f988479174e53071161c4a9de5e75f
7
+ data.tar.gz: e87a18a54dfb5a88291a419babf3db4ce01b291d746aa1ebaae9af52250ced8e0b0cdc36ce02686c43c9993de17dcd78b47ecf7ed8ed05c51494aef9c222c884
data/Gemfile CHANGED
@@ -1,2 +1,11 @@
1
1
  source 'https://rubygems.org'
2
+
2
3
  gemspec
4
+
5
+ logstash_path = ENV["LOGSTASH_PATH"] || "../../logstash"
6
+ use_logstash_source = ENV["LOGSTASH_SOURCE"] && ENV["LOGSTASH_SOURCE"].to_s == "1"
7
+
8
+ if Dir.exist?(logstash_path) && use_logstash_source
9
+ gem 'logstash-core', :path => "#{logstash_path}/logstash-core"
10
+ gem 'logstash-core-plugin-api', :path => "#{logstash_path}/logstash-core-plugin-api"
11
+ end
@@ -0,0 +1,213 @@
1
+ :plugin: google_pubsub
2
+ :type: input
3
+
4
+ ///////////////////////////////////////////
5
+ START - GENERATED VARIABLES, DO NOT EDIT!
6
+ ///////////////////////////////////////////
7
+ :version: %VERSION%
8
+ :release_date: %RELEASE_DATE%
9
+ :changelog_url: %CHANGELOG_URL%
10
+ :include_path: ../../../../logstash/docs/include
11
+ ///////////////////////////////////////////
12
+ END - GENERATED VARIABLES, DO NOT EDIT!
13
+ ///////////////////////////////////////////
14
+
15
+ [id="plugins-{type}-{plugin}"]
16
+
17
+ === Google_pubsub input plugin
18
+
19
+ include::{include_path}/plugin_header.asciidoc[]
20
+
21
+ ==== Description
22
+
23
+ Author: Eric Johnson <erjohnso@google.com>
24
+ Date: 2016-06-01
25
+
26
+ Copyright 2016 Google Inc.
27
+
28
+ Licensed under the Apache License, Version 2.0 (the "License");
29
+ you may not use this file except in compliance with the License.
30
+ You may obtain a copy of the License at
31
+
32
+ http://www.apache.org/licenses/LICENSE-2.0
33
+
34
+ Unless required by applicable law or agreed to in writing, software
35
+ distributed under the License is distributed on an "AS IS" BASIS,
36
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37
+ See the License for the specific language governing permissions and
38
+ limitations under the License.
39
+ Google deps
40
+ This is a https://github.com/elastic/logstash[Logstash] input plugin for
41
+ https://cloud.google.com/pubsub/[Google Pub/Sub]. The plugin can subscribe
42
+ to a topic and ingest messages.
43
+
44
+ The main motivation behind the development of this plugin was to ingest
45
+ https://cloud.google.com/logging/[Stackdriver Logging] messages via the
46
+ https://cloud.google.com/logging/docs/export/using_exported_logs[Exported Logs]
47
+ feature of Stackdriver Logging.
48
+
49
+ ==== Prerequisites
50
+
51
+ You must first create a Google Cloud Platform project and enable the the
52
+ Google Pub/Sub API. If you intend to use the plugin ingest Stackdriver Logging
53
+ messages, you must also enable the Stackdriver Logging API and configure log
54
+ exporting to Pub/Sub. There is plentiful information on
55
+ https://cloud.google.com/ to get started:
56
+
57
+ - Google Cloud Platform Projects and https://cloud.google.com/docs/overview/[Overview]
58
+ - Google Cloud Pub/Sub https://cloud.google.com/pubsub/[documentation]
59
+ - Stackdriver Logging https://cloud.google.com/logging/[documentation]
60
+
61
+ ==== Cloud Pub/Sub
62
+
63
+ Currently, this module requires you to create a `topic` manually and specify
64
+ it in the logstash config file. You must also specify a `subscription`, but
65
+ the plugin will attempt to create the pull-based `subscription` on its own.
66
+
67
+ All messages received from Pub/Sub will be converted to a logstash `event`
68
+ and added to the processing pipeline queue. All Pub/Sub messages will be
69
+ `acknowledged` and removed from the Pub/Sub `topic` (please see more about
70
+ https://cloud.google.com/pubsub/overview#concepts)[Pub/Sub concepts].
71
+
72
+ It is generally assumed that incoming messages will be in JSON and added to
73
+ the logstash `event` as-is. However, if a plain text message is received, the
74
+ plugin will return the raw text in as `raw_message` in the logstash `event`.
75
+
76
+ ==== Authentication
77
+
78
+ You have two options for authentication depending on where you run Logstash.
79
+
80
+ 1. If you are running Logstash outside of Google Cloud Platform, then you will
81
+ need to create a Google Cloud Platform Service Account and specify the full
82
+ path to the JSON private key file in your config. You must assign sufficient
83
+ roles to the Service Account to create a subscription and to pull messages
84
+ from the subscription. Learn more about GCP Service Accounts and IAM roles
85
+ here:
86
+
87
+ - Google Cloud Platform IAM https://cloud.google.com/iam/[overview]
88
+ - Creating Service Accounts https://cloud.google.com/iam/docs/creating-managing-service-accounts[overview]
89
+ - Granting Roles https://cloud.google.com/iam/docs/granting-roles-to-service-accounts[overview]
90
+
91
+ 1. If you are running Logstash on a Google Compute Engine instance, you may opt
92
+ to use Application Default Credentials. In this case, you will not need to
93
+ specify a JSON private key file in your config.
94
+
95
+ ==== Stackdriver Logging (optional)
96
+
97
+ If you intend to use the logstash plugin for Stackdriver Logging message
98
+ ingestion, you must first manually set up the Export option to Cloud Pub/Sub and
99
+ the manually create the `topic`. Please see the more detailed instructions at,
100
+ https://cloud.google.com/logging/docs/export/using_exported_logs [Exported Logs]
101
+ and ensure that the https://cloud.google.com/logging/docs/export/configure_export#manual-access-pubsub[necessary permissions]
102
+ have also been manually configured.
103
+
104
+ Logging messages from Stackdriver Logging exported to Pub/Sub are received as
105
+ JSON and converted to a logstash `event` as-is in
106
+ https://cloud.google.com/logging/docs/export/using_exported_logs#log_entries_in_google_pubsub_topics[this format].
107
+
108
+ ==== Sample Configuration
109
+
110
+ Below is a copy of the included `example.conf-tmpl` file that shows a basic
111
+ configuration for this plugin.
112
+
113
+ [source,ruby]
114
+ ----------------------------------
115
+ input {
116
+ google_pubsub {
117
+ # Your GCP project id (name)
118
+ project_id => "my-project-1234"
119
+
120
+ # The topic name below is currently hard-coded in the plugin. You
121
+ # must first create this topic by hand and ensure you are exporting
122
+ # logging to this pubsub topic.
123
+ topic => "logstash-input-dev"
124
+
125
+ # The subscription name is customizeable. The plugin will attempt to
126
+ # create the subscription (but use the hard-coded topic name above).
127
+ subscription => "logstash-sub"
128
+
129
+ # If you are running logstash within GCE, it will use
130
+ # Application Default Credentials and use GCE's metadata
131
+ # service to fetch tokens. However, if you are running logstash
132
+ # outside of GCE, you will need to specify the service account's
133
+ # JSON key file below.
134
+ #json_key_file => "/home/erjohnso/pkey.json"
135
+ }
136
+ }
137
+ output { stdout { codec => rubydebug } }
138
+ ----------------------------------
139
+
140
+
141
+ [id="plugins-{type}s-{plugin}-options"]
142
+ ==== Google_pubsub Input Configuration Options
143
+
144
+ This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
145
+
146
+ [cols="<,<,<",options="header",]
147
+ |=======================================================================
148
+ |Setting |Input type|Required
149
+ | <<plugins-{type}s-{plugin}-json_key_file>> |a valid filesystem path|No
150
+ | <<plugins-{type}s-{plugin}-max_messages>> |<<number,number>>|Yes
151
+ | <<plugins-{type}s-{plugin}-project_id>> |<<string,string>>|Yes
152
+ | <<plugins-{type}s-{plugin}-subscription>> |<<string,string>>|Yes
153
+ | <<plugins-{type}s-{plugin}-topic>> |<<string,string>>|Yes
154
+ |=======================================================================
155
+
156
+ Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
157
+ input plugins.
158
+
159
+ &nbsp;
160
+
161
+ [id="plugins-{type}s-{plugin}-json_key_file"]
162
+ ===== `json_key_file`
163
+
164
+ * Value type is <<path,path>>
165
+ * There is no default value for this setting.
166
+
167
+ If logstash is running within Google Compute Engine, the plugin will use
168
+ GCE's Application Default Credentials. Outside of GCE, you will need to
169
+ specify a Service Account JSON key file.
170
+
171
+ [id="plugins-{type}s-{plugin}-max_messages"]
172
+ ===== `max_messages`
173
+
174
+ * This is a required setting.
175
+ * Value type is <<number,number>>
176
+ * Default value is `5`
177
+
178
+
179
+
180
+ [id="plugins-{type}s-{plugin}-project_id"]
181
+ ===== `project_id`
182
+
183
+ * This is a required setting.
184
+ * Value type is <<string,string>>
185
+ * There is no default value for this setting.
186
+
187
+ Google Cloud Project ID (name, not number)
188
+
189
+ [id="plugins-{type}s-{plugin}-subscription"]
190
+ ===== `subscription`
191
+
192
+ * This is a required setting.
193
+ * Value type is <<string,string>>
194
+ * There is no default value for this setting.
195
+
196
+
197
+
198
+ [id="plugins-{type}s-{plugin}-topic"]
199
+ ===== `topic`
200
+
201
+ * This is a required setting.
202
+ * Value type is <<string,string>>
203
+ * There is no default value for this setting.
204
+
205
+ Google Cloud Pub/Sub Topic and Subscription.
206
+ Note that the topic must be created manually with Cloud Logging
207
+ pre-configured export to PubSub configured to use the defined topic.
208
+ The subscription will be created automatically by the plugin.
209
+
210
+
211
+
212
+ [id="plugins-{type}s-{plugin}-common-options"]
213
+ include::{include_path}/{type}.asciidoc[]
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-google_pubsub'
3
- s.version = '1.0.0'
3
+ s.version = '1.0.1'
4
4
  s.licenses = ['Apache-2.0']
5
5
  s.summary = "Logstash input plugin for Google Cloud Pub/Sub."
6
6
  s.description = "This gem is a Logstash input plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program."
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.require_paths = ["lib"]
11
11
 
12
12
  # Files
13
- s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
13
+ s.files = Dir["lib/**/*","spec/**/*","*.gemspec","*.md","CONTRIBUTORS","Gemfile","LICENSE","NOTICE.TXT", "vendor/jar-dependencies/**/*.jar", "vendor/jar-dependencies/**/*.rb", "VERSION", "docs/**/*"]
14
14
  # Tests
15
15
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
16
16
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-google_pubsub
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Johnson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-28 00:00:00.000000000 Z
11
+ date: 2017-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -92,7 +92,9 @@ dependencies:
92
92
  - - ">="
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
- description: This gem is a Logstash input plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program.
95
+ description: This gem is a Logstash input plugin required to be installed on top of
96
+ the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This
97
+ gem is not a stand-alone program.
96
98
  email: erjohnso@google.com
97
99
  executables: []
98
100
  extensions: []
@@ -104,6 +106,7 @@ files:
104
106
  - LICENSE
105
107
  - NOTICE.TXT
106
108
  - README.md
109
+ - docs/index.asciidoc
107
110
  - lib/logstash/inputs/google_pubsub.rb
108
111
  - logstash-input-google_pubsub.gemspec
109
112
  - spec/inputs/google_pubsub_spec.rb
@@ -129,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
132
  version: '0'
130
133
  requirements: []
131
134
  rubyforge_project:
132
- rubygems_version: 2.4.8
135
+ rubygems_version: 2.6.11
133
136
  signing_key:
134
137
  specification_version: 4
135
138
  summary: Logstash input plugin for Google Cloud Pub/Sub.