Skip to content

Commit e505ae9

Browse files
author
shumin
committed
add docs for redis sink and source
Signed-off-by: shumin <[email protected]>
1 parent 648c26f commit e505ae9

File tree

4 files changed

+251
-0
lines changed

4 files changed

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

docs/reference/services/redis.cue

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

docs/reference/urls.cue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,4 +498,6 @@ urls: {
498498
yum: "\(wikipedia)/wiki/Yum_(software)"
499499
zlib: "https://www.zlib.net"
500500
zstd: "https://zstd.net"
501+
redis: "https://redis.io"
502+
redis_rs: "https://github.com/mitsuhiko/redis-rs"
501503
}

0 commit comments

Comments
 (0)