Skip to content

Commit 418d423

Browse files
author
diego herrera
committed
upsert, update and remove bulk
1 parent 51358bd commit 418d423

19 files changed

+196
-400
lines changed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/logstash-output-mongodb.iml

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,6 @@
1-
## 3.1.5
2-
- Fixed @timestamp handling, BSON::ObjectId generation, close method [#57](https://github.com/logstash-plugins/logstash-output-mongodb/pull/57)
3-
4-
## 3.1.4
5-
- Docs: Set the default_codec doc attribute.
6-
7-
## 3.1.3
8-
- Update gemspec summary
9-
10-
## 3.1.2
11-
- Fix some documentation issues
12-
13-
## 3.1.0
14-
- Add support for bulk inserts to improve performance.
15-
16-
## 3.0.1
17-
- Docs: Fix doc generation issue by removing extraneous comments and adding a short description of the plugin
18-
19-
## 3.0.0
20-
- Breaking: Updated plugin to use new Java Event APIs
21-
- relax logstash-core-plugin-api constrains
22-
- update .travis.yml
23-
24-
## 2.0.5
25-
- Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
26-
27-
## 2.0.4
28-
- New dependency requirements for logstash-core for the 5.0 release
29-
30-
## 2.0.3
31-
- Patch Timestamp and BigDecimal with to_bson method and register with BSON.
32-
33-
## 2.0.0
34-
- Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
35-
instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
36-
- Dependency on logstash-core update to 2.0
37-
381
## 1.0.0
39-
- Fixes the plugin to be in the 2.0 series
40-
- Add integration and unit test to the project
41-
- Adapt the codebase to be 2.0 compatible
42-
- Make the internal logger in mongo to report to LS logger
43-
44-
## 0.2.0
45-
- Add basic registration test to the project
2+
- Basic integration for
3+
- insert
4+
- update
5+
- upsert
6+
- delete

CONTRIBUTORS

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,7 @@ The following is a list of people who have contributed ideas, code, bug
22
reports, or in general have helped logstash along its way.
33

44
Contributors:
5-
* Aaron Mildenstein (untergeek)
6-
* Graham Bleach (bleach)
7-
* John E. Vincent (lusis)
8-
* Jordan Sissel (jordansissel)
9-
* Kevin Amorin (kamorin)
10-
* Kevin O'Connor (kjoconnor)
11-
* Kurt Hurtado (kurtado)
12-
* Mathias Gug (zimathias)
13-
* Pete Fritchman (fetep)
14-
* Pier-Hugues Pellerin (ph)
15-
* Richard Pijnenburg (electrical)
16-
* bitsofinfo (bitsofinfo)
17-
* Guy Boertje (guyboertje)
18-
* Colin Surprenant (colinsurprenant)
5+
* Diego Herrera (lancha90)
196

207
Note: If you've sent us patches, bug reports, or otherwise contributed to
218
Logstash, and you aren't on the list above and want to be, please let us know

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,17 @@ bin/plugin install --no-verify
8787
```
8888
- Start Logstash and proceed to test the plugin
8989

90+
## Publish
91+
92+
```sh
93+
# Build Gem
94+
gem build logstash-output-mongo.gemspec
95+
96+
# Publish Gem
97+
gem push logstash-output-mongo-1.0.0.gem
98+
```
99+
100+
90101
## Contributing
91102

92103
All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.

lib/logstash/outputs/bson/big_decimal.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ module BigDecimal
3333
# 1.221311.to_bson
3434
# @return [ String ] The encoded string.
3535
# @see http://bsonspec.org/#/specification
36-
def to_bson(encoded = ''.force_encoding(BINARY))
37-
encoded << [ self ].pack(PACK)
36+
def to_bson(buffer = ByteBuffer.new, validating_keys = Config.validating_keys?)
37+
buffer.put_bytes([ self ].pack(PACK))
3838
end
3939

4040
module ClassMethods
@@ -44,7 +44,7 @@ module ClassMethods
4444
# @return [ BigDecimal ] The decoded BigDecimal.
4545
# @see http://bsonspec.org/#/specification
4646
def from_bson(bson)
47-
from_bson_double(bson.read(8))
47+
from_bson_double(bson.get_bytes(8))
4848
end
4949

5050
private
@@ -63,4 +63,4 @@ def from_bson_double(double)
6363
# @since 2.0.0
6464
::BigDecimal.send(:include, BigDecimal)
6565
::BigDecimal.send(:extend, BigDecimal::ClassMethods)
66-
end
66+
end

lib/logstash/outputs/bson/logstash_event.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module LogStashEvent
3030
# Event.new("field" => "value").to_bson
3131
# @return [ String ] The encoded string.
3232
# @see http://bsonspec.org/#/specification
33-
def to_bson(buffer = ByteBuffer.new)
33+
def to_bson(buffer = ByteBuffer.new, validating_keys = Config.validating_keys?)
3434
position = buffer.length
3535
buffer.put_int32(0)
3636
to_hash.each do |field, value|
@@ -73,4 +73,4 @@ def from_bson(buffer)
7373
# Enrich the core LogStash::Event class with this module.
7474
::LogStash::Event.send(:include, ::LogStashEvent)
7575
::LogStash::Event.send(:extend, ::LogStashEvent::ClassMethods)
76-
end
76+
end

0 commit comments

Comments
 (0)