Support for REDIS ZSET#46
Open
amaury-d wants to merge 19 commits into
Open
Conversation
This commit adds support for ZSET queues in REDIS with data_type 'list'. Batch is supported. Priority is based on a field of the message containing a number. If the field is absent or not a number a default priority is then used. It adds the following options to the configuration: * **priority**: *boolean*, default false, enable priority mode * **priority_field**: *string*, default '@timestamp', Priority field to use, if field doesn't exist, priority will be priority_default * **priority_default**: *number*, default '0', Default priority when priority field is not found in the event Usage example: output { redis { host => ["127.0.0.1"] port => 6379 data_type => "list" key => "syslog" priority => true priority_field => "epoch" } }
Author
|
This pull request is linked to logstash-plugins/logstash-input-redis#56 |
|
@amaury-d Can you please add some rspec tests for these changes? This is a rather significant update and some tests are absolutely necessary. |
Author
|
@untergeek Sure, i'll work on it and update the pull request |
Sometimes redis didn't have the time to ingest all messages and the test fails randomly. It appeared it was due to redis too short timeout.
As sorted sets are a native redis data type, it's best to support ZSET through data_type option instead to boolean priority option. A first group of integration tests (batched and unbatched) for sorted sets is also added with this commit.
This commit adds support for ZSET queues in REDIS with data_type 'list'. Batch is supported. Priority is based on a field of the message containing a number. If the field is absent or not a number a default priority is then used. It adds the following options to the configuration: * **priority**: *boolean*, default false, enable priority mode * **priority_field**: *string*, default '@timestamp', Priority field to use, if field doesn't exist, priority will be priority_default * **priority_default**: *number*, default '0', Default priority when priority field is not found in the event Usage example: output { redis { host => ["127.0.0.1"] port => 6379 data_type => "list" key => "syslog" priority => true priority_field => "epoch" } }
Sometimes redis didn't have the time to ingest all messages and the test fails randomly. It appeared it was due to redis too short timeout.
As sorted sets are a native redis data type, it's best to support ZSET through data_type option instead to boolean priority option. A first group of integration tests (batched and unbatched) for sorted sets is also added with this commit.
Author
|
Hi @untergeek @andrewvc , rspec tests and supplementary documentation have been added to pull requests (input and output). |
|
Hello, How can I download you changes? I need them also Thanks |
Author
|
@zivziv77 just go on my github or check the diff of that pull request |
|
Thanks, why not putting it in master and have it in the official release? |
|
Would you be nice and explain to me step step how can I install it on prod
machine?
…On Tue, 26 Jun 2018 at 19:19 Amaury Decreme ***@***.***> wrote:
@zivziv77 <https://github.com/zivziv77> just go on my github or check the
diff of that pull request
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#46 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALyLUPXbM9vdPMckMhGMLfkgvC5A4Cfpks5uAl8XgaJpZM4L5bFX>
.
|
|
@amaury-d Does it supports NX/XX options along with ZADD command ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit adds support for ZSET queues in REDIS with data_type
sortedset.Batch is supported.
Priority is based on a field of the message containing a number.
If the field is absent or not a number a default priority is then used.
It adds the following options to the configuration:
use, if field doesn't exist, priority will be priority_default
priority field is not found in the event
Usage example:
=> The messages will be push to a sortedset with the key
syslogusing the content of the fieldmyepochfieldas score.Thanks for contributing to Logstash! If you haven't already signed our CLA, here's a handy link: https://www.elastic.co/contributor-agreement/