Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mongo plugin with actions #76

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

arichiardi
Copy link

Hi there!

My company uses logstash-output-mongodb for building up projections from events and we needed some more fine grained functionality that would allow us to specify the kind of query we send to mongo (of particular importance was sending update-one including $inc.

I have been piggiebacking on the work done by @nik9000 in #74 and introduced a bit more to it. The two branches can definitely be merged and I welcome any improvement and willing to maintain it.

In particular my commit introduces, along with :action, an explicit :filter 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.

Finally, action is now fully dynamic and expanded via event.sprintf as in logstash-output-elasticsearch.

Is there any interest in merging?

@cla-checker-service
Copy link

cla-checker-service bot commented Oct 11, 2020

❌ Author of the following commits did not sign a Contributor Agreement:
, , , , , , 7cc4283, 1fb9e92, 75fc6fb, 8a04990

Please, read and sign the above mentioned agreement if you want to contribute to this project

nilskuhn and others added 8 commits October 13, 2020 10:36
fixing mongo driver version to 2.6
probably doesn't make sense in most use cases and causes trouble if size or order of array elements changes
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.
@arichiardi arichiardi force-pushed the mongo-actions branch 3 times, most recently from 1d5ee93 to 8a04990 Compare October 16, 2020 20:56
This option makes possible to set a maximum number the plugin will retry writes
for. It defaults to retry forever (negative max_retries) to keep backward
compatibility.
This option makes possible to set a maximum number the plugin will retry writes
for. It defaults to retry forever (negative max_retries) to keep backward
compatibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants