logstash-integration-jdbc 5.0.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +8 -0
  3. data/CONTRIBUTORS +22 -0
  4. data/Gemfile +11 -0
  5. data/LICENSE +13 -0
  6. data/NOTICE.TXT +5 -0
  7. data/README.md +105 -0
  8. data/docs/filter-jdbc_static.asciidoc +606 -0
  9. data/docs/filter-jdbc_streaming.asciidoc +317 -0
  10. data/docs/index.asciidoc +32 -0
  11. data/docs/input-jdbc.asciidoc +573 -0
  12. data/lib/logstash/filters/jdbc/basic_database.rb +125 -0
  13. data/lib/logstash/filters/jdbc/column.rb +39 -0
  14. data/lib/logstash/filters/jdbc/db_object.rb +101 -0
  15. data/lib/logstash/filters/jdbc/loader.rb +119 -0
  16. data/lib/logstash/filters/jdbc/loader_schedule.rb +64 -0
  17. data/lib/logstash/filters/jdbc/lookup.rb +253 -0
  18. data/lib/logstash/filters/jdbc/lookup_processor.rb +100 -0
  19. data/lib/logstash/filters/jdbc/lookup_result.rb +40 -0
  20. data/lib/logstash/filters/jdbc/read_only_database.rb +57 -0
  21. data/lib/logstash/filters/jdbc/read_write_database.rb +108 -0
  22. data/lib/logstash/filters/jdbc/repeating_load_runner.rb +13 -0
  23. data/lib/logstash/filters/jdbc/single_load_runner.rb +46 -0
  24. data/lib/logstash/filters/jdbc/validatable.rb +46 -0
  25. data/lib/logstash/filters/jdbc_static.rb +240 -0
  26. data/lib/logstash/filters/jdbc_streaming.rb +196 -0
  27. data/lib/logstash/inputs/jdbc.rb +341 -0
  28. data/lib/logstash/inputs/tzinfo_jruby_patch.rb +57 -0
  29. data/lib/logstash/plugin_mixins/jdbc/checked_count_logger.rb +43 -0
  30. data/lib/logstash/plugin_mixins/jdbc/jdbc.rb +298 -0
  31. data/lib/logstash/plugin_mixins/jdbc/statement_handler.rb +129 -0
  32. data/lib/logstash/plugin_mixins/jdbc/value_tracking.rb +140 -0
  33. data/lib/logstash/plugin_mixins/jdbc_streaming/cache_payload.rb +28 -0
  34. data/lib/logstash/plugin_mixins/jdbc_streaming/parameter_handler.rb +64 -0
  35. data/lib/logstash/plugin_mixins/jdbc_streaming/statement_handler.rb +143 -0
  36. data/lib/logstash/plugin_mixins/jdbc_streaming.rb +100 -0
  37. data/lib/logstash/plugin_mixins/statement_handler.rb +0 -0
  38. data/lib/logstash-integration-jdbc_jars.rb +5 -0
  39. data/logstash-integration-jdbc.gemspec +44 -0
  40. data/spec/filters/env_helper.rb +10 -0
  41. data/spec/filters/integration/jdbc_static_spec.rb +154 -0
  42. data/spec/filters/integration/jdbcstreaming_spec.rb +173 -0
  43. data/spec/filters/jdbc/column_spec.rb +70 -0
  44. data/spec/filters/jdbc/db_object_spec.rb +81 -0
  45. data/spec/filters/jdbc/loader_spec.rb +77 -0
  46. data/spec/filters/jdbc/lookup_processor_spec.rb +132 -0
  47. data/spec/filters/jdbc/lookup_spec.rb +253 -0
  48. data/spec/filters/jdbc/read_only_database_spec.rb +67 -0
  49. data/spec/filters/jdbc/read_write_database_spec.rb +90 -0
  50. data/spec/filters/jdbc/repeating_load_runner_spec.rb +24 -0
  51. data/spec/filters/jdbc/single_load_runner_spec.rb +16 -0
  52. data/spec/filters/jdbc_static_file_local_spec.rb +83 -0
  53. data/spec/filters/jdbc_static_spec.rb +162 -0
  54. data/spec/filters/jdbc_streaming_spec.rb +350 -0
  55. data/spec/filters/remote_server_helper.rb +24 -0
  56. data/spec/filters/shared_helpers.rb +34 -0
  57. data/spec/helpers/WHY-THIS-JAR.txt +4 -0
  58. data/spec/helpers/derbyrun.jar +0 -0
  59. data/spec/inputs/integration/integ_spec.rb +78 -0
  60. data/spec/inputs/jdbc_spec.rb +1431 -0
  61. data/vendor/jar-dependencies/org/apache/derby/derby/10.14.1.0/derby-10.14.1.0.jar +0 -0
  62. data/vendor/jar-dependencies/org/apache/derby/derbyclient/10.14.1.0/derbyclient-10.14.1.0.jar +0 -0
  63. metadata +319 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f759657c1178a3981ec4bc08de8e4efbb81a87feae4315f61f6efdc825cd5d03
4
+ data.tar.gz: 1574ed773e16e4fd34812157bfc26df00dcfc2f0ab0de0fab7c8d012267c28c9
5
+ SHA512:
6
+ metadata.gz: f4ceab2ea85b49a428efe7248a76ee42931974b70c0e139bdb390b57f3c7d66a36a1c0c59f0953bac9be0f7566fbfa977dfc37b8916683377fb5d979ef070c83
7
+ data.tar.gz: 290b00f0f7a909c7148bd8a22dcc42a67ca360050eb0f9cd1aa898471de06e9535a795dade26cae6a5615f2a5e80437a92d84efcfaae8ebf45df5a1c05596d6e
data/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ ## 5.0.0
2
+ - Initial Release of JDBC Integration Plugin, incorporating [logstash-input-jdbc](https://github.com/logstash-plugins/logstash-input-jdbc), [logstash-filter-jdbc_streaming](https://github.com/logstash-plugins/logstash-filter-jdbc_streaming) and
3
+ [logstash-filter-jdbc_static](https://github.com/logstash-plugins/logstash-filter-jdbc_static)
4
+ - For Changelog of individual plugins, see:
5
+ - [JBDC Input version 4.3.19](https://github.com/logstash-plugins/logstash-input-jdbc/blob/v4.3.19/CHANGELOG.md)
6
+ - [JDBC Static filter version 1.1.0](https://github.com/logstash-plugins/logstash-filter-jdbc_static/blob/v1.1.0/CHANGELOG.md)
7
+ - [JDBC Streaming filter version 1.0.10](https://github.com/logstash-plugins/logstash-filter-jdbc_streaming/blob/v1.0.10/CHANGELOG.md)
8
+
data/CONTRIBUTORS ADDED
@@ -0,0 +1,22 @@
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
+ * Christian Paredes (cparedes)
6
+ * Colin Surprenant (colinsurprenant)
7
+ * Jay Luker (lbjay)
8
+ * John E. Vincent (lusis)
9
+ * Jordan Sissel (jordansissel)
10
+ * João Duarte (jsvd)
11
+ * Laust Rud Jacobsen (rud)
12
+ * Nikolay Bryskin (nikicat)
13
+ * Pete Fritchman (fetep)
14
+ * Philippe Weber (wiibaa)
15
+ * Pier-Hugues Pellerin (ph)
16
+ * Suyog Rao (suyograo)
17
+ * Guy Boertje (guyboertje)
18
+
19
+ Note: If you've sent us patches, bug reports, or otherwise contributed to
20
+ Logstash, and you aren't on the list above and want to be, please let us know
21
+ and we'll make sure you're here. Contributions from folks like you are what make
22
+ 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
@@ -0,0 +1,5 @@
1
+ Elasticsearch
2
+ Copyright 2012-2018 Elasticsearch
3
+
4
+ This product includes software developed by The Apache Software
5
+ Foundation (http://www.apache.org/).
data/README.md ADDED
@@ -0,0 +1,105 @@
1
+ # logstash-integration-jdbc
2
+ Logstash Integration Plugin for JDBC, including Logstash Input and Filter Plugins
3
+ # Logstash Plugin
4
+
5
+ [![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-integration-jdbc.svg)](https://travis-ci.org/logstash-plugins/logstash-integration-jdbc)
6
+
7
+ This is a plugin for [Logstash](https://github.com/elastic/logstash).
8
+
9
+ 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.
10
+
11
+ ## Documentation
12
+
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
+ ## Need Help?
19
+
20
+ Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.
21
+
22
+ ## Developing
23
+
24
+ ### 1. Plugin Development and Testing
25
+
26
+ #### Code
27
+ - To get started, you'll need JRuby with the Bundler gem installed.
28
+
29
+ - Clone from the GitHub [logstash-plugins](https://github.com/logstash-plugins/logstash-integration-jdbc) organization.
30
+
31
+ - Install vendor JDBC jars
32
+ ```sh
33
+ ./gradlew vendor
34
+ ```
35
+
36
+ - Install dependencies
37
+ ```sh
38
+ bundle install
39
+ ```
40
+
41
+ #### Test
42
+
43
+ - Update your dependencies
44
+
45
+ ```sh
46
+ bundle install
47
+ ```
48
+
49
+ - Run tests
50
+
51
+ ```sh
52
+ bundle exec rspec
53
+ ```
54
+
55
+ ### 2. Running your unpublished Plugin in Logstash
56
+
57
+ #### 2.1 Run in a local Logstash clone
58
+
59
+ - Edit Logstash `Gemfile` and add the local plugin path, for example:
60
+ ```ruby
61
+ gem "logstash-integration-jdbc", :path => "/your/local/logstash-integration-jdbc"
62
+ ```
63
+ - Install plugin
64
+ ```sh
65
+ # Logstash 2.3 and higher
66
+ bin/logstash-plugin install --no-verify
67
+
68
+ # Prior to Logstash 2.3
69
+ bin/plugin install --no-verify
70
+
71
+ ```
72
+ - Run Logstash with your plugin
73
+ ```sh
74
+ bin/logstash -e 'filter {jdbc_streaming {}}'
75
+ ```
76
+ At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
77
+
78
+ #### 2.2 Run in an installed Logstash
79
+
80
+ 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:
81
+
82
+ - Build your plugin gem
83
+ ```sh
84
+ gem build logstash-integration-jdbc.gemspec
85
+ ```
86
+ - Install the plugin from the Logstash home
87
+ ```sh
88
+ # Logstash 2.3 and higher
89
+ bin/logstash-plugin install --no-verify
90
+
91
+ # Prior to Logstash 2.3
92
+ bin/plugin install --no-verify
93
+
94
+ ```
95
+ - Start Logstash and proceed to test the plugin
96
+
97
+ ## Contributing
98
+
99
+ All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.
100
+
101
+ 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.
102
+
103
+ It is more important to the community that you are able to contribute.
104
+
105
+ For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.