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

add remove_from_default boolean option to route_to_stream function #220

Merged
merged 2 commits into from Oct 19, 2017

Conversation

@kroepke
Copy link
Member

@kroepke kroepke commented Oct 19, 2017

this allows remove messages from the default stream like the stream router already does

with the remove_from_stream function any arbitrary stream can be removed. it always makes sure that the message is at least on the default stream. dropping messages this way is not supported, the user must use drop_message for that purpose.

fixes #117

this allows remove messages from the default stream like the stream router already does
@kroepke kroepke added this to the 3.0.0 milestone Oct 19, 2017
@ghost ghost assigned kroepke Oct 19, 2017
this function removes the function from the given streams (via name or id)
if the message would be taken off all streams, it is routed back to the default stream to avoid dropping the message accidentally
@@ -46,8 +46,6 @@
import org.graylog.plugins.pipelineprocessor.functions.encoding.Base32Encode;
import org.graylog.plugins.pipelineprocessor.functions.encoding.Base32HumanDecode;
import org.graylog.plugins.pipelineprocessor.functions.encoding.Base32HumanEncode;
import org.graylog.plugins.pipelineprocessor.functions.encoding.Base64Decode;
import org.graylog.plugins.pipelineprocessor.functions.encoding.Base64Encode;

This comment has been minimized.

@joschi

joschi Oct 19, 2017
Contributor

Uh oh, that's not a good sign.
That means someone forgot to add these functions…

Refs #190

}
final Message message = messageParam.optional(args, context).orElse(context.currentMessage());
streams.forEach(stream -> {
if (!stream.isPaused()) {

This comment has been minimized.

@joschi

joschi Oct 19, 2017
Contributor

Why is it important whether a stream is paused or not?

This comment has been minimized.

@kroepke

kroepke Oct 19, 2017
Author Member

It's not particularly, but paused streams aren't taken into account when adding either.
Actually more of a cargo cult copy'n'waste artifact from the route_to_stream function and the StreamRouter.

@joschi joschi merged commit 03958fe into master Oct 19, 2017
4 checks passed
4 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
graylog-project/pr Jenkins build graylog-project-pr-snapshot 627 has succeeded
Details
license/cla Contributor License Agreement is signed.
Details
@joschi
Copy link
Contributor

@joschi joschi commented Oct 19, 2017

@kroepke Please adapt the functions documentation in https://github.com/Graylog2/documentation/ accordingly.

@joschi joschi deleted the issue-117 branch Oct 19, 2017
joschi pushed a commit that referenced this pull request Oct 19, 2017
* Add `remove_from_default` boolean option to `route_to_stream()` function

This allows remove messages from the default stream like the stream router already does

* Add `remove_from_stream()` function

This function removes the function from the given streams (via name or id)
if the message would be taken off all streams, it is routed back to the default stream to avoid dropping the message accidentally

(cherry picked from commit 03958fe)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.