You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit introduces :filter (instead of :query-key and :query-value) for
defining the query that we pass down to Mongo. It is a hash and will allow us
to filter by a composite key.
In addition to that :update_expressions is now another optional hash that can
be added to *replace* the default $set operator.
The hash is a set of Mongo Update
Expressions (https://docs.mongodb.com/manual/reference/operator/update/#id1)
and the values are also substituted. Note that pipeline (Mongo >= 4.2) support
is not there yet.
Finally, action is now fully dynamic and expanded via sprintf as in
logstash-output-elasticsearch.
This is a fork of [logstash-plugins/logstash-output-mongodb](https://github.com/logstash-plugins/logstash-output-mongodb).
5
+
6
+
It adds the :action, :filter, :update_expressions and :upsert parameters
7
+
---
4
8
5
9
This is a plugin for [Logstash](https://github.com/elastic/logstash).
6
10
@@ -21,20 +25,17 @@ Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/log
21
25
22
26
### 1. Plugin Developement and Testing
23
27
24
-
#### Code
25
-
- To get started, you'll need JRuby with the Bundler gem installed.
28
+
For developing this plugin we use the wonderful work of [cameronkerrnz/logstash-plugin-dev](https://github.com/cameronkerrnz/logstash-plugin-dev):
26
29
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).
30
+
To start an interactive environment run:
28
31
29
-
- Install dependencies
30
-
```sh
31
-
bundle install
32
+
```sh
33
+
docker run --rm -it -v ${PWD}:/work cameronkerrnz/logstash-plugin-dev:7.9
32
34
```
33
35
34
-
#### Test
35
-
36
-
- Update your dependencies
36
+
After that you can run the usual suspects:
37
37
38
+
- Install/Update dependencies
38
39
```sh
39
40
bundle install
40
41
```
@@ -95,4 +96,4 @@ Programming is not a required skill. Whatever you've seen about open source and
95
96
96
97
It is more important to the community that you are able to contribute.
97
98
98
-
For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.
99
+
For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.
# The Mongo DB action to perform. Valid actions are:
48
+
#
49
+
# - insert: inserts a document, fails if a document the document already exists.
50
+
# - update: updates a document given a `filter`. You can also upsert a document, see the `upsert` option.
51
+
# - delete: *Not Supported* at the moment
52
+
#
53
+
# A sprintf-able string is allowed to change the action based on the content
54
+
# of the event. The value `%{[foo]}` would use the foo field for the action.
55
+
#
56
+
# For more details on actions, check out the https://docs.mongodb.com/ruby-driver/v2.6/tutorials/ruby-driver-bulk-operations[Mongo Ruby Driver documentation]
Copy file name to clipboardExpand all lines: logstash-output-mongodb.gemspec
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
Gem::Specification.newdo |s|
2
2
s.name='logstash-output-mongodb'
3
-
s.version='3.2.0'
3
+
s.version='3.2.1'
4
4
s.licenses=['Apache License (2.0)']
5
5
s.summary="Writes events to MongoDB"
6
6
s.description="This gem is a Logstash 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"
0 commit comments