Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b0c3bec

Browse files
author
Juuso Mäyränen
committedApr 7, 2020
Update docs
1 parent 3ce0cb2 commit b0c3bec

File tree

2 files changed

+46
-8
lines changed

2 files changed

+46
-8
lines changed
 

‎docs/index.asciidoc

+44-6
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,14 @@ Redis allows for the renaming or disabling of commands in its protocol, see: ht
8484
===== `data_type`
8585

8686
* This is a required setting.
87-
* Value can be any of: `list`, `channel`, `pattern_channel`
87+
* Value can be any of: `list`, `pattern_list`, `channel`, `pattern_channel`
8888
* There is no default value for this setting.
8989

9090
Specify either list or channel. If `data_type` is `list`, then we will BLPOP the
91-
key. If `data_type` is `channel`, then we will SUBSCRIBE to the key.
92-
If `data_type` is `pattern_channel`, then we will PSUBSCRIBE to the key.
91+
key. If `data_type` is `pattern_list`, then we will spawn a number of worker
92+
threads that will LPOP from keys matching that pattern. If `data_type` is
93+
`channel`, then we will SUBSCRIBE to the key. If `data_type` is
94+
`pattern_channel`, then we will PSUBSCRIBE to the key.
9395

9496
[id="plugins-{type}s-{plugin}-db"]
9597
===== `db`
@@ -125,6 +127,17 @@ The unix socket path of your Redis server.
125127

126128
The name of a Redis list or channel.
127129

130+
[id="plugins-{type}s-{plugin}-max_items_per_worker"]
131+
===== `max_items_per_worker`
132+
133+
* Value type is <<number,number>>
134+
* Default value is `1000`
135+
136+
Maximum number of items for a single worker thread to process when `data_type` is `pattern_list`.
137+
After the list is empty or this number of items have been processed, the thread will exit and a
138+
new one will be started if there are non-empty lists matching the pattern without a consumer.
139+
140+
128141
[id="plugins-{type}s-{plugin}-password"]
129142
===== `password`
130143

@@ -142,22 +155,37 @@ Password to authenticate with. There is no authentication by default.
142155
The port to connect on.
143156

144157
[id="plugins-{type}s-{plugin}-ssl"]
145-
===== `ssl`
158+
===== `ssl`
146159

147160
* Value type is <<boolean,boolean>>
148161
* Default value is `false`
149162

150163
Enable SSL support.
151164

152165

166+
[id="plugins-{type}s-{plugin}-max_items_per_worker"]
167+
===== `timeout`
168+
169+
* Value type is <<number,number>>
170+
* Default value is `1000`
171+
172+
[id="plugins-{type}s-{plugin}-threadpool_queue_sleep"]
173+
===== `threadpool_queue_sleep`
174+
175+
* Value type is <<number,number>>
176+
* Default value is `0.2`
177+
178+
Time to sleep in main loop after checking if more threads can/need to be spawned.
179+
Applies to `data_type` is `pattern_list`
180+
181+
153182
[id="plugins-{type}s-{plugin}-threads"]
154183
===== `threads`
155184

156185
* Value type is <<number,number>>
157186
* Default value is `1`
158187

159188

160-
161189
[id="plugins-{type}s-{plugin}-timeout"]
162190
===== `timeout`
163191

@@ -166,7 +194,17 @@ Enable SSL support.
166194

167195
Initial connection timeout in seconds.
168196

197+
198+
[id="plugins-{type}s-{plugin}-worker_thread_count"]
199+
===== `worker_thread_count`
200+
201+
* Value type is <<number,number>>
202+
* Default value is `20`
203+
204+
Maximum number of worker threads to spawn when using `data_type` `pattern_list`.
205+
206+
169207
[id="plugins-{type}s-{plugin}-common-options"]
170208
include::{include_path}/{type}.asciidoc[]
171209

172-
:default_codec!:
210+
:default_codec!:

‎lib/logstash/inputs/redis.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ module LogStash module Inputs class Redis < LogStash::Inputs::Threadable
6868
config :worker_thread_count, :validate => :number, :default => 20
6969

7070
# Maximum number of items for a single worker thread to process when `data_type` is `pattern_list`.
71-
# After the queue is empty or this number of items have been processed, the thread will exit and a
72-
# new one will be started.
71+
# After the list is empty or this number of items have been processed, the thread will exit and a
72+
# new one will be started if there are non-empty lists matching the pattern without a consumer.
7373
config :max_items_per_worker, :validate => :number, :default => 1000
7474

7575
# Time to sleep in main loop after checking if more threads can/need to be spawned.

0 commit comments

Comments
 (0)
Please sign in to comment.