logstash-output-google_cloud_storage 4.0.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +77 -0
- data/CONTRIBUTORS +18 -0
- data/Gemfile +11 -0
- data/LICENSE +13 -0
- data/NOTICE.TXT +5 -0
- data/README.md +100 -0
- data/docs/index.asciidoc +305 -0
- data/lib/logstash-output-google_cloud_storage_jars.rb +35 -0
- data/lib/logstash/outputs/gcs/client.rb +88 -0
- data/lib/logstash/outputs/gcs/log_rotate.rb +77 -0
- data/lib/logstash/outputs/gcs/path_factory.rb +119 -0
- data/lib/logstash/outputs/gcs/temp_log_file.rb +111 -0
- data/lib/logstash/outputs/gcs/worker_pool.rb +47 -0
- data/lib/logstash/outputs/google_cloud_storage.rb +276 -0
- data/logstash-output-google_cloud_storage.gemspec +33 -0
- data/spec/fixtures/credentials.json +8 -0
- data/spec/outputs/gcs/client_spec.rb +18 -0
- data/spec/outputs/gcs/log_rotate_spec.rb +129 -0
- data/spec/outputs/gcs/path_factory_spec.rb +189 -0
- data/spec/outputs/gcs/temp_log_file_spec.rb +155 -0
- data/spec/outputs/gcs/worker_pool_spec.rb +29 -0
- data/spec/outputs/google_cloud_storage_spec.rb +23 -0
- data/spec/spec_helper.rb +3 -0
- data/vendor/jar-dependencies/com/fasterxml/jackson/core/jackson-core/2.9.6/jackson-core-2.9.6.jar +0 -0
- data/vendor/jar-dependencies/com/google/api-client/google-api-client/1.23.0/google-api-client-1.23.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/api-client/google-api-client/1.24.1/google-api-client-1.24.1.jar +0 -0
- data/vendor/jar-dependencies/com/google/api-client/google-api-client/1.27.0/google-api-client-1.27.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/api/api-common/1.5.0/api-common-1.5.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/api/api-common/1.7.0/api-common-1.7.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/api/gax-httpjson/0.40.0/gax-httpjson-0.40.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/api/gax-httpjson/0.47.0/gax-httpjson-0.47.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/api/gax-httpjson/0.59.0/gax-httpjson-0.59.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/api/gax/1.23.0/gax-1.23.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/api/gax/1.30.0/gax-1.30.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/api/gax/1.42.0/gax-1.42.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/api/grpc/proto-google-common-protos/1.12.0/proto-google-common-protos-1.12.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/api/grpc/proto-google-common-protos/1.14.0/proto-google-common-protos-1.14.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/api/grpc/proto-google-common-protos/1.7.0/proto-google-common-protos-1.7.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/api/grpc/proto-google-iam-v1/0.12.0/proto-google-iam-v1-0.12.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/api/grpc/proto-google-iam-v1/0.8.0/proto-google-iam-v1-0.8.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/apis/google-api-services-storage/v1-rev114-1.23.0/google-api-services-storage-v1-rev114-1.23.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/apis/google-api-services-storage/v1-rev135-1.24.1/google-api-services-storage-v1-rev135-1.24.1.jar +0 -0
- data/vendor/jar-dependencies/com/google/apis/google-api-services-storage/v1-rev20181109-1.27.0/google-api-services-storage-v1-rev20181109-1.27.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/auth/google-auth-library-credentials/0.10.0/google-auth-library-credentials-0.10.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/auth/google-auth-library-credentials/0.13.0/google-auth-library-credentials-0.13.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/auth/google-auth-library-credentials/0.9.0/google-auth-library-credentials-0.9.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/auth/google-auth-library-oauth2-http/0.10.0/google-auth-library-oauth2-http-0.10.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/auth/google-auth-library-oauth2-http/0.13.0/google-auth-library-oauth2-http-0.13.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/auth/google-auth-library-oauth2-http/0.9.0/google-auth-library-oauth2-http-0.9.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/cloud/google-cloud-core-http/1.25.0/google-cloud-core-http-1.25.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/cloud/google-cloud-core-http/1.39.0/google-cloud-core-http-1.39.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/cloud/google-cloud-core-http/1.65.0/google-cloud-core-http-1.65.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/cloud/google-cloud-core/1.25.0/google-cloud-core-1.25.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/cloud/google-cloud-core/1.39.0/google-cloud-core-1.39.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/cloud/google-cloud-core/1.65.0/google-cloud-core-1.65.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/cloud/google-cloud-storage/1.25.0/google-cloud-storage-1.25.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/cloud/google-cloud-storage/1.39.0/google-cloud-storage-1.39.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/cloud/google-cloud-storage/1.65.0/google-cloud-storage-1.65.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/code/findbugs/jsr305/3.0.1/jsr305-3.0.1.jar +0 -0
- data/vendor/jar-dependencies/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar +0 -0
- data/vendor/jar-dependencies/com/google/code/gson/gson/2.7/gson-2.7.jar +0 -0
- data/vendor/jar-dependencies/com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3.jar +0 -0
- data/vendor/jar-dependencies/com/google/errorprone/error_prone_annotations/2.2.0/error_prone_annotations-2.2.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/guava/guava-jdk5/17.0/guava-jdk5-17.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/guava/guava/20.0/guava-20.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/guava/guava/26.0-android/guava-26.0-android.jar +0 -0
- data/vendor/jar-dependencies/com/google/http-client/google-http-client-apache/2.0.0/google-http-client-apache-2.0.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/http-client/google-http-client-appengine/1.23.0/google-http-client-appengine-1.23.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/http-client/google-http-client-appengine/1.24.1/google-http-client-appengine-1.24.1.jar +0 -0
- data/vendor/jar-dependencies/com/google/http-client/google-http-client-appengine/1.28.0/google-http-client-appengine-1.28.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/http-client/google-http-client-jackson/1.23.0/google-http-client-jackson-1.23.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/http-client/google-http-client-jackson/1.24.1/google-http-client-jackson-1.24.1.jar +0 -0
- data/vendor/jar-dependencies/com/google/http-client/google-http-client-jackson2/1.23.0/google-http-client-jackson2-1.23.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/http-client/google-http-client-jackson2/1.24.1/google-http-client-jackson2-1.24.1.jar +0 -0
- data/vendor/jar-dependencies/com/google/http-client/google-http-client-jackson2/1.28.0/google-http-client-jackson2-1.28.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/http-client/google-http-client/1.23.0/google-http-client-1.23.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/http-client/google-http-client/1.24.1/google-http-client-1.24.1.jar +0 -0
- data/vendor/jar-dependencies/com/google/http-client/google-http-client/1.28.0/google-http-client-1.28.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar +0 -0
- data/vendor/jar-dependencies/com/google/oauth-client/google-oauth-client/1.23.0/google-oauth-client-1.23.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/oauth-client/google-oauth-client/1.24.1/google-oauth-client-1.24.1.jar +0 -0
- data/vendor/jar-dependencies/com/google/oauth-client/google-oauth-client/1.27.0/google-oauth-client-1.27.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/protobuf/protobuf-java-util/3.5.1/protobuf-java-util-3.5.1.jar +0 -0
- data/vendor/jar-dependencies/com/google/protobuf/protobuf-java-util/3.6.0/protobuf-java-util-3.6.0.jar +0 -0
- data/vendor/jar-dependencies/com/google/protobuf/protobuf-java/3.5.1/protobuf-java-3.5.1.jar +0 -0
- data/vendor/jar-dependencies/com/google/protobuf/protobuf-java/3.6.0/protobuf-java-3.6.0.jar +0 -0
- data/vendor/jar-dependencies/commons-codec/commons-codec/1.3/commons-codec-1.3.jar +0 -0
- data/vendor/jar-dependencies/commons-codec/commons-codec/1.9/commons-codec-1.9.jar +0 -0
- data/vendor/jar-dependencies/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar +0 -0
- data/vendor/jar-dependencies/commons-logging/commons-logging/1.2/commons-logging-1.2.jar +0 -0
- data/vendor/jar-dependencies/io/grpc/grpc-context/1.12.0/grpc-context-1.12.0.jar +0 -0
- data/vendor/jar-dependencies/io/grpc/grpc-context/1.9.0/grpc-context-1.9.0.jar +0 -0
- data/vendor/jar-dependencies/io/opencensus/opencensus-api/0.11.1/opencensus-api-0.11.1.jar +0 -0
- data/vendor/jar-dependencies/io/opencensus/opencensus-api/0.15.0/opencensus-api-0.15.0.jar +0 -0
- data/vendor/jar-dependencies/io/opencensus/opencensus-contrib-http-util/0.11.1/opencensus-contrib-http-util-0.11.1.jar +0 -0
- data/vendor/jar-dependencies/io/opencensus/opencensus-contrib-http-util/0.15.0/opencensus-contrib-http-util-0.15.0.jar +0 -0
- data/vendor/jar-dependencies/joda-time/joda-time/2.9.2/joda-time-2.9.2.jar +0 -0
- data/vendor/jar-dependencies/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1.jar +0 -0
- data/vendor/jar-dependencies/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3.jar +0 -0
- data/vendor/jar-dependencies/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar +0 -0
- data/vendor/jar-dependencies/org/apache/httpcomponents/httpcore/4.4.6/httpcore-4.4.6.jar +0 -0
- data/vendor/jar-dependencies/org/codehaus/jackson/jackson-core-asl/1.9.11/jackson-core-asl-1.9.11.jar +0 -0
- data/vendor/jar-dependencies/org/threeten/threetenbp/1.3.3/threetenbp-1.3.3.jar +0 -0
- metadata +249 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 78d40dc9f25fa3b8dd031f56c3aac1fe8c50f265172ed60d455424006d29fb53
|
4
|
+
data.tar.gz: 22e58b552acc6099c14838559139ec3b78247c335bf7d386d115ad940b242e14
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ffa0273458eba309b372f23d2db63398bee76fd4e79efe084fb5b7b931aaa1666603a22313c88b5b31c82c923ba3965c3434edecad9f78aca457f03c0ecb176d
|
7
|
+
data.tar.gz: f4b3cd0a25cb1972f196be3b73d002c782f22397248d5921f087ef0c30ba8099eb7ebb17a0ae183a29ac18d6cf58cd1d4d8411166bccae8c7f158ddeaf4ff2ff
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
## 4.0.0
|
2
|
+
- Move to the Java Google Cloud client library for increased performance and stability.
|
3
|
+
- **Breaking** If you use the old PKCS12 authentication keys, you will need to upgrade to
|
4
|
+
the new JSON keys. Application Default Credentials will continue to work.
|
5
|
+
|
6
|
+
### Configuration Changes
|
7
|
+
|
8
|
+
**New Options**
|
9
|
+
|
10
|
+
- `json_key_file` - The JSON IAM service account credentials to use with the plugin.
|
11
|
+
|
12
|
+
**Deprecations**
|
13
|
+
|
14
|
+
- `key_password` - No longer used with `json_key_file`
|
15
|
+
- `service_account` - No longer used with `json_key_file`
|
16
|
+
|
17
|
+
**Obsoletions**
|
18
|
+
|
19
|
+
- `key_path` - Use `json_key_file` or Application Default Credentials (ADC) instead.
|
20
|
+
See [the documentation](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-google_cloud_storage.html#plugins-outputs-google_cloud_storage-key_path)
|
21
|
+
for help about moving to JSON key files.
|
22
|
+
|
23
|
+
## 3.3.0
|
24
|
+
Added the ability to set `gzip` as `Content-Encoding`.
|
25
|
+
This saves storage size but still allows uncompressed downloads.
|
26
|
+
|
27
|
+
- Fixes [#13](https://github.com/logstash-plugins/logstash-output-google_cloud_storage/issues/13) - Use `gzip` for `Content-Encoding` instead of `Content-Type`
|
28
|
+
|
29
|
+
## 3.2.1
|
30
|
+
- Refactoring work to add locks to file rotation and writing.
|
31
|
+
- Fixes [#2](https://github.com/logstash-plugins/logstash-output-google_cloud_storage/issues/2) - Plugin crashes on file rotation.
|
32
|
+
- Fixes [#19](https://github.com/logstash-plugins/logstash-output-google_cloud_storage/issues/19) - Deleted files remain in use by the system eventually filling up disk space.
|
33
|
+
|
34
|
+
## 3.2.0
|
35
|
+
- Change uploads to use a job pool for better performance
|
36
|
+
- Fixes [#22](https://github.com/logstash-plugins/logstash-output-google_cloud_storage/issues/22) - Refactor Job Queue Architecture
|
37
|
+
- Fixes [#5](https://github.com/logstash-plugins/logstash-output-google_cloud_storage/issues/5) - Major Performance Issues
|
38
|
+
- Wait for files to upload before Logstash quits
|
39
|
+
- Fixes [#15](https://github.com/logstash-plugins/logstash-output-google_cloud_storage/issues/15) - Fails to upload files when Logstash exits
|
40
|
+
|
41
|
+
## 3.1.0
|
42
|
+
- Add support for disabling hostname in the log file names
|
43
|
+
- Add support for adding a UUID to the log file names
|
44
|
+
|
45
|
+
## 3.0.5
|
46
|
+
- Docs: Set the default_codec doc attribute.
|
47
|
+
|
48
|
+
## 3.0.4
|
49
|
+
- Fix some documentation issues
|
50
|
+
|
51
|
+
## 3.0.2
|
52
|
+
- Docs: Fix doc formatting
|
53
|
+
|
54
|
+
## 3.0.1
|
55
|
+
- align the dependency on mime-type and google-api-client with the `logstash-output-google_bigquery`
|
56
|
+
|
57
|
+
## 3.0.0
|
58
|
+
- Breaking: Updated plugin to use new Java Event APIs
|
59
|
+
- relax contraints on logstash-core-plugin-api
|
60
|
+
- Update .travis.yml
|
61
|
+
- Freeze google-api-client and mime-types
|
62
|
+
- use concurrency :single
|
63
|
+
|
64
|
+
## 2.0.4
|
65
|
+
- Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
|
66
|
+
|
67
|
+
## 2.0.3
|
68
|
+
- New dependency requirements for logstash-core for the 5.0 release
|
69
|
+
|
70
|
+
## 2.0.0
|
71
|
+
- Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
|
72
|
+
instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
|
73
|
+
- Dependency on logstash-core update to 2.0
|
74
|
+
|
75
|
+
## 0.2.0
|
76
|
+
- Changed the Google Cloud Storage API version to v1
|
77
|
+
- Added simple test for plugin lookup
|
data/CONTRIBUTORS
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
The following is a list of people who have contributed ideas, code, bug
|
2
|
+
reports, or in general have helped logstash along its way.
|
3
|
+
|
4
|
+
Contributors:
|
5
|
+
* Aaron Mildenstein (untergeek)
|
6
|
+
* Ethan Estrada (eestrada)
|
7
|
+
* Google LLC.
|
8
|
+
* Jordan Sissel (jordansissel)
|
9
|
+
* Joseph Lewis III (jlewisiii)
|
10
|
+
* MetaPipe
|
11
|
+
* Pier-Hugues Pellerin (ph)
|
12
|
+
* Richard Pijnenburg (electrical)
|
13
|
+
* Rodrigo De Castro (rdcastro)
|
14
|
+
|
15
|
+
Note: If you've sent us patches, bug reports, or otherwise contributed to
|
16
|
+
Logstash, and you aren't on the list above and want to be, please let us know
|
17
|
+
and we'll make sure you're here. Contributions from folks like you are what make
|
18
|
+
open source awesome.
|
data/Gemfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
source 'https://rubygems.org'
|
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
|
data/LICENSE
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Copyright (c) 2012-2018 Elasticsearch <http://www.elastic.co>
|
2
|
+
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
data/NOTICE.TXT
ADDED
data/README.md
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
# Logstash Plugin
|
2
|
+
|
3
|
+
[![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-output-google_cloud_storage.svg)](https://travis-ci.org/logstash-plugins/logstash-output-google_cloud_storage)
|
4
|
+
|
5
|
+
This is a plugin for [Logstash](https://github.com/elastic/logstash).
|
6
|
+
|
7
|
+
It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
|
8
|
+
|
9
|
+
## Documentation
|
10
|
+
|
11
|
+
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/).
|
12
|
+
|
13
|
+
- For formatting code or config example, you can use the asciidoc `[source,ruby]` directive
|
14
|
+
- For more asciidoc formatting tips, see the excellent reference here https://github.com/elastic/docs#asciidoc-guide
|
15
|
+
|
16
|
+
## Need Help?
|
17
|
+
|
18
|
+
Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.
|
19
|
+
|
20
|
+
## Developing
|
21
|
+
|
22
|
+
### 1. Plugin Developement and Testing
|
23
|
+
|
24
|
+
#### Code
|
25
|
+
- To get started, you'll need JRuby with the Bundler gem installed.
|
26
|
+
|
27
|
+
- 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).
|
28
|
+
|
29
|
+
- Install dependencies
|
30
|
+
```sh
|
31
|
+
bundle install
|
32
|
+
bundle exec rake vendor
|
33
|
+
```
|
34
|
+
|
35
|
+
#### Test
|
36
|
+
|
37
|
+
- Update your dependencies
|
38
|
+
|
39
|
+
```sh
|
40
|
+
bundle install
|
41
|
+
bundle exec rake vendor
|
42
|
+
```
|
43
|
+
|
44
|
+
- Run tests
|
45
|
+
|
46
|
+
```sh
|
47
|
+
bundle exec rspec
|
48
|
+
```
|
49
|
+
|
50
|
+
### 2. Running your unpublished Plugin in Logstash
|
51
|
+
|
52
|
+
#### 2.1 Run in a local Logstash clone
|
53
|
+
|
54
|
+
- Edit Logstash `Gemfile` and add the local plugin path, for example:
|
55
|
+
```ruby
|
56
|
+
gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
|
57
|
+
```
|
58
|
+
- Install plugin
|
59
|
+
```sh
|
60
|
+
# Logstash 2.3 and higher
|
61
|
+
bin/logstash-plugin install --no-verify
|
62
|
+
|
63
|
+
# Prior to Logstash 2.3
|
64
|
+
bin/plugin install --no-verify
|
65
|
+
|
66
|
+
```
|
67
|
+
- Run Logstash with your plugin
|
68
|
+
```sh
|
69
|
+
bin/logstash -e 'filter {awesome {}}'
|
70
|
+
```
|
71
|
+
At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
|
72
|
+
|
73
|
+
#### 2.2 Run in an installed Logstash
|
74
|
+
|
75
|
+
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:
|
76
|
+
|
77
|
+
- Build your plugin gem
|
78
|
+
```sh
|
79
|
+
gem build logstash-filter-awesome.gemspec
|
80
|
+
```
|
81
|
+
- Install the plugin from the Logstash home
|
82
|
+
```sh
|
83
|
+
# Logstash 2.3 and higher
|
84
|
+
bin/logstash-plugin install --no-verify
|
85
|
+
|
86
|
+
# Prior to Logstash 2.3
|
87
|
+
bin/plugin install --no-verify
|
88
|
+
|
89
|
+
```
|
90
|
+
- Start Logstash and proceed to test the plugin
|
91
|
+
|
92
|
+
## Contributing
|
93
|
+
|
94
|
+
All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.
|
95
|
+
|
96
|
+
Programming is not a required skill. Whatever you've seen about open source and maintainers or community members saying "send patches or die" - you will not see that here.
|
97
|
+
|
98
|
+
It is more important to the community that you are able to contribute.
|
99
|
+
|
100
|
+
For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.
|
data/docs/index.asciidoc
ADDED
@@ -0,0 +1,305 @@
|
|
1
|
+
:plugin: google_cloud_storage
|
2
|
+
:type: output
|
3
|
+
:default_codec: plain
|
4
|
+
|
5
|
+
///////////////////////////////////////////
|
6
|
+
START - GENERATED VARIABLES, DO NOT EDIT!
|
7
|
+
///////////////////////////////////////////
|
8
|
+
:version: %VERSION%
|
9
|
+
:release_date: %RELEASE_DATE%
|
10
|
+
:changelog_url: %CHANGELOG_URL%
|
11
|
+
:include_path: ../../../../logstash/docs/include
|
12
|
+
///////////////////////////////////////////
|
13
|
+
END - GENERATED VARIABLES, DO NOT EDIT!
|
14
|
+
///////////////////////////////////////////
|
15
|
+
|
16
|
+
[id="plugins-{type}s-{plugin}"]
|
17
|
+
|
18
|
+
=== Google Cloud Storage output plugin
|
19
|
+
|
20
|
+
include::{include_path}/plugin_header.asciidoc[]
|
21
|
+
|
22
|
+
==== Description
|
23
|
+
|
24
|
+
A plugin to upload log events to Google Cloud Storage (GCS), rolling
|
25
|
+
files based on the date pattern provided as a configuration setting. Events
|
26
|
+
are written to files locally and, once file is closed, this plugin uploads
|
27
|
+
it to the configured bucket.
|
28
|
+
|
29
|
+
For more info on Google Cloud Storage, please go to:
|
30
|
+
https://cloud.google.com/products/cloud-storage
|
31
|
+
|
32
|
+
In order to use this plugin, a Google service account must be used. For
|
33
|
+
more information, please refer to:
|
34
|
+
https://developers.google.com/storage/docs/authentication#service_accounts
|
35
|
+
|
36
|
+
Recommendation: experiment with the settings depending on how much log
|
37
|
+
data you generate, so the uploader can keep up with the generated logs.
|
38
|
+
Using gzip output can be a good option to reduce network traffic when
|
39
|
+
uploading the log files and in terms of storage costs as well.
|
40
|
+
|
41
|
+
==== Usage
|
42
|
+
|
43
|
+
This is an example of logstash config:
|
44
|
+
|
45
|
+
[source,json]
|
46
|
+
--------------------------
|
47
|
+
output {
|
48
|
+
google_cloud_storage {
|
49
|
+
bucket => "my_bucket" (required)
|
50
|
+
json_key_file => "/path/to/privatekey.json" (optional)
|
51
|
+
temp_directory => "/tmp/logstash-gcs" (optional)
|
52
|
+
log_file_prefix => "logstash_gcs" (optional)
|
53
|
+
max_file_size_kbytes => 1024 (optional)
|
54
|
+
output_format => "plain" (optional)
|
55
|
+
date_pattern => "%Y-%m-%dT%H:00" (optional)
|
56
|
+
flush_interval_secs => 2 (optional)
|
57
|
+
gzip => false (optional)
|
58
|
+
gzip_content_encoding => false (optional)
|
59
|
+
uploader_interval_secs => 60 (optional)
|
60
|
+
include_uuid => true (optional)
|
61
|
+
include_hostname => true (optional)
|
62
|
+
}
|
63
|
+
}
|
64
|
+
--------------------------
|
65
|
+
|
66
|
+
===== Additional Resources
|
67
|
+
|
68
|
+
* https://cloud.google.com/docs/authentication/production[Application Default Credentials (ADC) Overview]
|
69
|
+
* https://cloud.google.com/storage/[Cloud Storage Introduction]
|
70
|
+
* https://cloud.google.com/storage/pricing[Pricing Information]
|
71
|
+
|
72
|
+
|
73
|
+
==== Improvements TODO List
|
74
|
+
|
75
|
+
* Support logstash event variables to determine filename.
|
76
|
+
* Turn Google API code into a Plugin Mixin (like AwsConfig).
|
77
|
+
* There's no recover method, so if logstash/plugin crashes, files may not
|
78
|
+
be uploaded to GCS.
|
79
|
+
* Allow user to configure file name.
|
80
|
+
* Allow parallel uploads for heavier loads (+ connection configuration if
|
81
|
+
exposed by Ruby API client)
|
82
|
+
|
83
|
+
[id="plugins-{type}s-{plugin}-options"]
|
84
|
+
==== Google_cloud_storage Output Configuration Options
|
85
|
+
|
86
|
+
This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
|
87
|
+
|
88
|
+
[cols="<,<,<",options="header",]
|
89
|
+
|=======================================================================
|
90
|
+
|Setting |Input type|Required
|
91
|
+
| <<plugins-{type}s-{plugin}-bucket>> |<<string,string>>|Yes
|
92
|
+
| <<plugins-{type}s-{plugin}-date_pattern>> |<<string,string>>|No
|
93
|
+
| <<plugins-{type}s-{plugin}-flush_interval_secs>> |<<number,number>>|No
|
94
|
+
| <<plugins-{type}s-{plugin}-gzip>> |<<boolean,boolean>>|No
|
95
|
+
| <<plugins-{type}s-{plugin}-gzip_content_encoding>> |<<boolean,boolean>>|No
|
96
|
+
| <<plugins-{type}s-{plugin}-include_hostname>> |<<boolean,boolean>>|No
|
97
|
+
| <<plugins-{type}s-{plugin}-include_uuid>> |<<boolean,boolean>>|No
|
98
|
+
| <<plugins-{type}s-{plugin}-json_key_file>> |<<string,string>>|No
|
99
|
+
| <<plugins-{type}s-{plugin}-key_password>> |<<string,string>>|__Deprecated__
|
100
|
+
| <<plugins-{type}s-{plugin}-key_path>> |<<string,string>>|**Obsolete**
|
101
|
+
| <<plugins-{type}s-{plugin}-log_file_prefix>> |<<string,string>>|No
|
102
|
+
| <<plugins-{type}s-{plugin}-max_concurrent_uploads>> |<<number,number>>|No
|
103
|
+
| <<plugins-{type}s-{plugin}-max_file_size_kbytes>> |<<number,number>>|No
|
104
|
+
| <<plugins-{type}s-{plugin}-output_format>> |<<string,string>>, one of `["json", "plain"]`|No
|
105
|
+
| <<plugins-{type}s-{plugin}-service_account>> |<<string,string>>|__Deprecated__
|
106
|
+
| <<plugins-{type}s-{plugin}-temp_directory>> |<<string,string>>|No
|
107
|
+
| <<plugins-{type}s-{plugin}-uploader_interval_secs>> |<<number,number>>|No
|
108
|
+
|=======================================================================
|
109
|
+
|
110
|
+
Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
|
111
|
+
output plugins.
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
[id="plugins-{type}s-{plugin}-bucket"]
|
116
|
+
===== `bucket`
|
117
|
+
|
118
|
+
* This is a required setting.
|
119
|
+
* Value type is <<string,string>>
|
120
|
+
* There is no default value for this setting.
|
121
|
+
|
122
|
+
GCS bucket name, without "gs://" or any other prefix.
|
123
|
+
|
124
|
+
[id="plugins-{type}s-{plugin}-date_pattern"]
|
125
|
+
===== `date_pattern`
|
126
|
+
|
127
|
+
* Value type is <<string,string>>
|
128
|
+
* Default value is `"%Y-%m-%dT%H:00"`
|
129
|
+
|
130
|
+
Time pattern for log file, defaults to hourly files.
|
131
|
+
Must Time.strftime patterns: www.ruby-doc.org/core-2.0/Time.html#method-i-strftime
|
132
|
+
|
133
|
+
[id="plugins-{type}s-{plugin}-flush_interval_secs"]
|
134
|
+
===== `flush_interval_secs`
|
135
|
+
|
136
|
+
* Value type is <<number,number>>
|
137
|
+
* Default value is `2`
|
138
|
+
|
139
|
+
Flush interval in seconds for flushing writes to log files. 0 will flush
|
140
|
+
on every message.
|
141
|
+
|
142
|
+
[id="plugins-{type}s-{plugin}-gzip"]
|
143
|
+
===== `gzip`
|
144
|
+
|
145
|
+
* Value type is <<boolean,boolean>>
|
146
|
+
* Default value is `false`
|
147
|
+
|
148
|
+
Gzip output stream when writing events to log files, set
|
149
|
+
`Content-Type` to `application/gzip` instead of `text/plain`, and
|
150
|
+
use file suffix `.log.gz` instead of `.log`.
|
151
|
+
|
152
|
+
[id="plugins-{type}s-{plugin}-gzip_content_encoding"]
|
153
|
+
===== `gzip_content_encoding`
|
154
|
+
|
155
|
+
added[3.3.0]
|
156
|
+
|
157
|
+
* Value type is <<boolean,boolean>>
|
158
|
+
* Default value is `false`
|
159
|
+
|
160
|
+
Gzip output stream when writing events to log files and set `Content-Encoding` to `gzip`.
|
161
|
+
This will upload your files as `gzip` saving network and storage costs, but they will be
|
162
|
+
transparently decompressed when you read them from the storage bucket.
|
163
|
+
|
164
|
+
See the Cloud Storage documentation on https://cloud.google.com/storage/docs/metadata#content-encoding[metadata] and
|
165
|
+
https://cloud.google.com/storage/docs/transcoding#content-type_vs_content-encoding[transcoding]
|
166
|
+
for more information.
|
167
|
+
|
168
|
+
**Note**: It is not recommended to use both `gzip_content_encoding` and `gzip`.
|
169
|
+
This compresses your file _twice_, will increase the work your machine does and makes
|
170
|
+
the files larger than just compressing once.
|
171
|
+
|
172
|
+
[id="plugins-{type}s-{plugin}-include_hostname"]
|
173
|
+
===== `include_hostname`
|
174
|
+
|
175
|
+
added[3.1.0]
|
176
|
+
|
177
|
+
* Value type is <<boolean,boolean>>
|
178
|
+
* Default value is `true`
|
179
|
+
|
180
|
+
Should the hostname be included in the file name?
|
181
|
+
You may want to turn this off for privacy reasons or if you are running multiple
|
182
|
+
instances of Logstash and need to match the files you create with a simple glob
|
183
|
+
such as if you wanted to import files to BigQuery.
|
184
|
+
|
185
|
+
|
186
|
+
[id="plugins-{type}s-{plugin}-include_uuid"]
|
187
|
+
===== `include_uuid`
|
188
|
+
|
189
|
+
added[3.1.0]
|
190
|
+
|
191
|
+
* Value type is <<boolean,boolean>>
|
192
|
+
* Default value is `false`
|
193
|
+
|
194
|
+
Adds a UUID to the end of a file name.
|
195
|
+
You may want to enable this feature so files don't clobber one another if you're
|
196
|
+
running multiple instances of Logstash or if you expect frequent node restarts.
|
197
|
+
|
198
|
+
[id="plugins-{type}s-{plugin}-json_key_file"]
|
199
|
+
===== `json_key_file`
|
200
|
+
|
201
|
+
* Value type is <<string,string>>
|
202
|
+
* Default value is `nil`
|
203
|
+
|
204
|
+
The plugin can use
|
205
|
+
https://cloud.google.com/docs/authentication/production[Application Default Credentials (ADC)],
|
206
|
+
if it's running on Compute Engine, Kubernetes Engine, App Engine, or Cloud Functions.
|
207
|
+
|
208
|
+
Outside of Google Cloud, you will need create a Service Account JSON key file through the
|
209
|
+
web interface or with the following command:
|
210
|
+
`gcloud iam service-accounts keys create key.json --iam-account my-sa-123@my-project-123.iam.gserviceaccount.com`
|
211
|
+
|
212
|
+
[id="plugins-{type}s-{plugin}-key_password"]
|
213
|
+
===== `key_password`
|
214
|
+
|
215
|
+
* Value type is <<string,string>>
|
216
|
+
* Default value is `"notasecret"`
|
217
|
+
|
218
|
+
**Deprecated** this feature is no longer used, the setting is now a part of <<plugins-{type}s-{plugin}-json_key_file>>.
|
219
|
+
|
220
|
+
|
221
|
+
[id="plugins-{type}s-{plugin}-key_path"]
|
222
|
+
===== `key_path`
|
223
|
+
|
224
|
+
* Value type is <<string,string>>
|
225
|
+
|
226
|
+
**Obsolete:** The PKCS12 key file format is no longer supported.
|
227
|
+
Please use one of the following mechanisms:
|
228
|
+
|
229
|
+
* https://cloud.google.com/docs/authentication/production[Application Default Credentials (ADC)],
|
230
|
+
configured via environment variables on Compute Engine, Kubernetes Engine, App Engine, or
|
231
|
+
Cloud Functions.
|
232
|
+
* A JSON authentication key file. You can generate them in the console for the service account
|
233
|
+
like you did with the `.P12` file or with the following command:
|
234
|
+
`gcloud iam service-accounts keys create key.json --iam-account my-sa-123@my-project-123.iam.gserviceaccount.com`
|
235
|
+
|
236
|
+
[id="plugins-{type}s-{plugin}-log_file_prefix"]
|
237
|
+
===== `log_file_prefix`
|
238
|
+
|
239
|
+
* Value type is <<string,string>>
|
240
|
+
* Default value is `"logstash_gcs"`
|
241
|
+
|
242
|
+
Log file prefix. Log file will follow the format:
|
243
|
+
<prefix>_hostname_date<.part?>.log
|
244
|
+
|
245
|
+
[id="plugins-{type}s-{plugin}-max_concurrent_uploads"]
|
246
|
+
===== `max_concurrent_uploads`
|
247
|
+
|
248
|
+
* Value type is <<number,number>>
|
249
|
+
* Default value is `5`
|
250
|
+
|
251
|
+
Sets the maximum number of concurrent uploads to Cloud Storage at a time.
|
252
|
+
Uploads are I/O bound so it makes sense to tune this paramater with regards
|
253
|
+
to the network bandwidth available and the latency between your server and
|
254
|
+
Cloud Storage.
|
255
|
+
|
256
|
+
[id="plugins-{type}s-{plugin}-max_file_size_kbytes"]
|
257
|
+
===== `max_file_size_kbytes`
|
258
|
+
|
259
|
+
* Value type is <<number,number>>
|
260
|
+
* Default value is `10000`
|
261
|
+
|
262
|
+
Sets max file size in kbytes. 0 disable max file check.
|
263
|
+
|
264
|
+
[id="plugins-{type}s-{plugin}-output_format"]
|
265
|
+
===== `output_format`
|
266
|
+
|
267
|
+
* Value can be any of: `json`, `plain`
|
268
|
+
* Default value is `"plain"`
|
269
|
+
|
270
|
+
The event format you want to store in files. Defaults to plain text.
|
271
|
+
|
272
|
+
[id="plugins-{type}s-{plugin}-service_account"]
|
273
|
+
===== `service_account`
|
274
|
+
|
275
|
+
* This is a required setting.
|
276
|
+
* Value type is <<string,string>>
|
277
|
+
* There is no default value for this setting.
|
278
|
+
|
279
|
+
**Deprecated** this feature is no longer used, the setting is now a part of <<plugins-{type}s-{plugin}-json_key_file>>.
|
280
|
+
|
281
|
+
[id="plugins-{type}s-{plugin}-temp_directory"]
|
282
|
+
===== `temp_directory`
|
283
|
+
|
284
|
+
* Value type is <<string,string>>
|
285
|
+
* Default value is `""`
|
286
|
+
|
287
|
+
Directory where temporary files are stored.
|
288
|
+
Defaults to /tmp/logstash-gcs-<random-suffix>
|
289
|
+
|
290
|
+
[id="plugins-{type}s-{plugin}-uploader_interval_secs"]
|
291
|
+
===== `uploader_interval_secs`
|
292
|
+
|
293
|
+
* Value type is <<number,number>>
|
294
|
+
* Default value is `60`
|
295
|
+
|
296
|
+
Uploader interval when uploading new files to GCS. Adjust time based
|
297
|
+
on your time pattern (for example, for hourly files, this interval can be
|
298
|
+
around one hour).
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
[id="plugins-{type}s-{plugin}-common-options"]
|
303
|
+
include::{include_path}/{type}.asciidoc[]
|
304
|
+
|
305
|
+
:default_codec!:
|