Skip to content

Commit 5d62b12

Browse files
author
shumin
committed
add docs for redis sink and source
Signed-off-by: shumin <shumin@compubiq.com>
1 parent cd947ef commit 5d62b12

File tree

4 files changed

+252
-0
lines changed

4 files changed

+252
-0
lines changed
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
package metadata
2+
3+
components: sinks: redis: {
4+
title: "Redis"
5+
description: "[Redis](\(urls.redis)) is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker."
6+
7+
classes: {
8+
commonly_used: false
9+
delivery: "best_effort"
10+
development: "beta"
11+
egress_method: "stream"
12+
service_providers: []
13+
}
14+
15+
features: {
16+
buffer: enabled: false
17+
healthcheck: enabled: true
18+
send: {
19+
compression: enabled: false
20+
encoding: {
21+
enabled: true
22+
codec: {
23+
enabled: true
24+
default: null
25+
enum: ["json", "text"]
26+
}
27+
}
28+
request: enabled: false
29+
tls: enabled: false
30+
to: {
31+
service: services.redis
32+
interface: {
33+
socket: {
34+
direction: "outgoing"
35+
protocols: ["tcp"]
36+
ssl: "disabled"
37+
}
38+
}
39+
}
40+
}
41+
}
42+
43+
support: {
44+
targets: {
45+
"aarch64-unknown-linux-gnu": true
46+
"aarch64-unknown-linux-musl": true
47+
"x86_64-apple-darwin": true
48+
"x86_64-pc-windows-msv": true
49+
"x86_64-unknown-linux-gnu": true
50+
"x86_64-unknown-linux-musl": true
51+
}
52+
53+
requirements: []
54+
warnings: []
55+
notices: []
56+
}
57+
58+
configuration: {
59+
url: {
60+
description: "The Redis URL to connect to. The url _must_ take the form of `redis://server:port/db`."
61+
groups: ["tcp"]
62+
required: true
63+
warnings: []
64+
type: string: {
65+
examples: ["redis://127.0.0.1:6379/0"]
66+
}
67+
}
68+
key: {
69+
description: "The Redis key to publish messages to."
70+
required: true
71+
warnings: []
72+
type: string: {
73+
examples: ["syslog:{{ app }}", "vector"]
74+
templateable: true
75+
}
76+
}
77+
data_type: {
78+
common: false
79+
description: "The Redis Data Type(list or channel) to use."
80+
required: false
81+
type: string: {
82+
default: "list"
83+
examples: ["list", "channel"]
84+
}
85+
}
86+
method: {
87+
common: false
88+
description: "The Method(lpush or rpush) to publish messages when data_type is list."
89+
required: false
90+
type: string: {
91+
default: "lpush"
92+
examples: ["lpush", "rpush"]
93+
}
94+
}
95+
}
96+
97+
input: {
98+
logs: true
99+
metrics: null
100+
}
101+
102+
how_it_works: {
103+
redis_rs: {
104+
title: "redis-rs"
105+
body: """
106+
The `redis` sink uses [`redis-rs`](\(urls.redis_rs)) under the hood. This
107+
is a is a high level redis library for Rust. It provides convenient access to all Redis functionality through a very flexible but low-level API.
108+
It uses a customizable type conversion trait so that any operation can return results in just the type you are expecting.
109+
This makes for a very pleasant development experience.
110+
"""
111+
}
112+
}
113+
}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
package metadata
2+
3+
components: sources: redis: {
4+
title: "Redis"
5+
description: "[Redis](\(urls.redis)) is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker."
6+
7+
features: {
8+
collect: {
9+
checkpoint: enabled: false
10+
tls: {
11+
enabled: true
12+
can_enable: true
13+
can_verify_certificate: false
14+
can_verify_hostname: false
15+
enabled_default: false
16+
}
17+
from: {
18+
service: services.redis
19+
interface: {
20+
socket: {
21+
direction: "incoming"
22+
port: 6379
23+
protocols: ["tcp"]
24+
ssl: "disabled"
25+
}
26+
}
27+
}
28+
}
29+
multiline: enabled: false
30+
}
31+
32+
classes: {
33+
commonly_used: false
34+
deployment_roles: ["aggregator"]
35+
delivery: "best_effort"
36+
development: "beta"
37+
egress_method: "stream"
38+
}
39+
40+
support: {
41+
targets: {
42+
"aarch64-unknown-linux-gnu": true
43+
"aarch64-unknown-linux-musl": true
44+
"x86_64-apple-darwin": true
45+
"x86_64-pc-windows-msv": true
46+
"x86_64-unknown-linux-gnu": true
47+
"x86_64-unknown-linux-musl": true
48+
}
49+
50+
requirements: []
51+
warnings: []
52+
notices: []
53+
}
54+
55+
installation: {
56+
platform_name: null
57+
}
58+
59+
configuration: {
60+
url: {
61+
description: "The Redis URL to connect to. The url _must_ take the form of `redis://server:port/db`."
62+
groups: ["tcp"]
63+
required: true
64+
warnings: []
65+
type: string: {
66+
examples: ["redis://127.0.0.1:6379/0"]
67+
}
68+
}
69+
key: {
70+
description: "The Redis key to read messages from."
71+
required: true
72+
warnings: []
73+
type: string: {
74+
examples: ["vector"]
75+
templateable: false
76+
}
77+
}
78+
data_type: {
79+
common: false
80+
description: "The Redis Data Type(list or channel) to use."
81+
required: false
82+
type: string: {
83+
default: "list"
84+
examples: ["list", "channel"]
85+
}
86+
}
87+
method: {
88+
common: false
89+
description: "The Method(brpop or blpop) to pop messages when data_type is list."
90+
required: false
91+
type: string: {
92+
default: "brpop"
93+
examples: ["brpop", "blpop"]
94+
}
95+
}
96+
redis_key: {
97+
common: false
98+
description: "The log field name to use for the redis key. If unspecified, the key would not be added to the log event."
99+
required: false
100+
warnings: []
101+
type: string: {
102+
default: null
103+
examples: ["redis_key"]
104+
}
105+
}
106+
}
107+
108+
output: logs: record: {
109+
description: "An individual Redis record"
110+
fields: {
111+
host: fields._local_host
112+
message: fields._raw_line
113+
timestamp: fields._current_timestamp
114+
}
115+
}
116+
117+
how_it_works: {
118+
redis_rs: {
119+
title: "redis-rs"
120+
body: """
121+
The `redis` source uses [`redis-rs`](\(urls.redis_rs)) under the hood. This
122+
is a is a high level redis library for Rust. It provides convenient access to all Redis functionality through a very flexible but low-level API.
123+
It uses a customizable type conversion trait so that any operation can return results in just the type you are expecting.
124+
This makes for a very pleasant development experience.
125+
"""
126+
}
127+
}
128+
}

docs/reference/services/redis.cue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package metadata
2+
3+
services: redis: {
4+
name: "Redis"
5+
thing: "a \(name) database"
6+
url: urls.redis
7+
description: "[Redis](\(urls.redis)) is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker."
8+
versions: null
9+
}

docs/reference/urls.cue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,4 +458,6 @@ urls: {
458458
yum: "https://en.wikipedia.org/wiki/Yum_(software)"
459459
zlib: "https://www.zlib.net"
460460
zstd: "https://zstd.net"
461+
redis: "https://redis.io"
462+
redis_rs: "https://github.com/mitsuhiko/redis-rs"
461463
}

0 commit comments

Comments
 (0)