Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
357 lines (316 loc) · 13.4 KB
/
Copy pathCargo.toml
File metadata and controls
357 lines (316 loc) · 13.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
[package]
name = "vrl"
version = "0.39.0"
authors = ["Vector Contributors <vector@datadoghq.com>"]
edition = "2024"
license = "MPL-2.0"
description = "Vector Remap Language"
homepage = "https://vrl.dev/"
repository = "https://github.com/vectordotdev/vrl"
readme = "README.md"
keywords = ["vector", "dsl", "processing", "observability", "datadog"]
categories = ["compilers"]
rust-version = "1.95" # msrv
[lints]
workspace = true
[workspace]
members = [
".",
"lib/tests",
"lib/fuzz",
"lib/docs",
"release",
]
default-members = ["."]
[workspace.lints.rust]
warnings = "deny"
[workspace.lints.clippy]
pedantic = "warn"
await_holding_lock = "warn"
unused_async = "warn"
uninlined_format_args = "warn"
borrow_as_ptr = "warn"
checked_conversions = "warn"
ptr_as_ptr = "warn"
[workspace.dependencies]
clap = { version = "4", features = ["derive"] }
[features]
default = ["compiler", "stdlib", "datadog", "cli", "enable_env_functions", "enable_system_functions", "enable_network_functions", "enable_crypto_functions"]
# Contains the primary data type used in VRL, along with path types. Useful for crates that work with VRL values without needing the full compiler.
value = ["dep:bytes", "dep:bytestring", "dep:regex", "dep:ordered-float", "dep:chrono", "dep:serde_json", "dep:simdutf8", "dep:serde", "dep:snafu"]
# Contains the core functionality of VRL: compiling and running VRL programs, parser, and diagnostics.
compiler = ["value", "dep:chrono-tz", "dep:thiserror", "dep:dyn-clone", "dep:indoc", "dep:lalrpop-util", "dep:codespan-reporting", "dep:termcolor"]
# Enables all Datadog-specific features (filter, grok, search).
datadog = ["compiler", "dep:regex", "dep:dyn-clone", "dep:nom", "dep:peeking_take_while", "dep:onig", "dep:percent-encoding", "dep:fancy-regex", "dep:pest", "dep:pest_derive", "dep:itertools", "dep:serde", "dep:url", "dep:roxmltree", "dep:rust_decimal"]
# Contains functionality to create a CLI for VRL.
cli = ["compiler", "dep:clap", "dep:serde_json", "dep:thiserror", "dep:exitcode", "dep:webbrowser", "dep:rustyline", "dep:prettytable-rs"]
# Contains the test framework for testing VRL functions. Useful for testing custom functions.
test_framework = ["compiler", "dep:prettydiff", "dep:serde_json", "dep:nu-ansi-term"]
# Implements `Arbitrary` (from the `quickcheck` crate) for the `Value` type.
arbitrary = ["dep:quickcheck", "dep:arbitrary"]
# Activates fixture-stable Arbitrary implementations for use with the native
# encoding fixture generator in the vector-core crate.
generate-fixtures = ["arbitrary"]
# Makes the `Value` type compatible with the `mlua` crate.
lua = ["dep:mlua"]
# Property-based testing support via proptest.
proptest = ["dep:proptest", "dep:proptest-derive"]
# Enables environment variable access functions (e.g. `get_env_var`).
enable_env_functions = []
# Enables system-level functions (e.g. `get_hostname`).
enable_system_functions = ["dep:relative-path"]
# Enables network I/O functions (e.g. `http_request`, `dns_lookup`, `reverse_dns`). Not supported on wasm32.
enable_network_functions = ["dep:reqwest", "dep:reqwest-middleware", "dep:reqwest-retry", "dep:rustls"]
# Enables cryptographic functions: hashing (MD5, SHA, xxHash, etc.), encryption (AES, ChaCha20, etc.), and MACs.
enable_crypto_functions = [
"dep:aes",
"dep:aes-siv",
"dep:cbc",
"dep:cfb-mode",
"dep:chacha20poly1305",
"dep:crypto_secretbox",
"dep:ctr",
"dep:digest",
"dep:hex",
"dep:hmac",
"dep:ipcrypt-rs",
"dep:md-5",
"dep:ofb",
"dep:seahash",
"dep:sha1",
"dep:sha2",
"dep:sha3",
"dep:xxhash-rust",
"dep:crc",
]
# Preserves float precision during JSON serialization/deserialization.
float_roundtrip = ["dep:serde_json", "serde_json/float_roundtrip"]
# Testing Utilities. Enables additional tests, including those with external dependencies such as network calls.
test = []
# Documentation generation support.
docs = ["stdlib", "indexmap/serde", "serde_json/preserve_order", "dep:clap", "dep:thiserror", "dep:exitcode"]
# All stdlib functions (base + all enable_* features)
stdlib = [
"stdlib-base",
"enable_crypto_functions",
"enable_env_functions",
"enable_system_functions",
"enable_network_functions"
]
# Base stdlib functionality (without enable_* features)
stdlib-base = [
"compiler",
"datadog",
"dep:base16",
"dep:base62",
"dep:base64-simd",
"dep:charset",
"dep:convert_case",
"dep:ciborium",
"dep:cidr",
"dep:community-id",
"dep:csv",
"dep:domain",
"dep:dns-lookup",
"dep:flate2",
"dep:grok",
"dep:hostname",
"dep:iana-time-zone",
"dep:idna",
"dep:indexmap",
"dep:influxdb-line-protocol",
"dep:nom",
"dep:parse-size",
"dep:percent-encoding",
"dep:prost",
"dep:prost-reflect",
"dep:psl",
"dep:psl-types",
"dep:publicsuffix",
"dep:quoted_printable",
"dep:rand",
"dep:roxmltree",
"dep:rust_decimal",
"dep:snap",
"dep:strip-ansi-escapes",
"dep:strum",
"dep:strum_macros",
"dep:syslog_loose",
"dep:tokio",
"dep:ua-parser",
"dep:url",
"dep:utf8-width",
"dep:uuid",
"dep:woothee",
"dep:zstd",
"dep:encoding_rs"
]
[dependencies]
cfg-if = "1"
# Optional dependencies
nu-ansi-term = { version = "0.50", optional = true }
arbitrary = { version = "1", optional = true, features = ["derive"] }
base16 = { version = "0.2", optional = true }
base62 = { version = "2.2.1", optional = true }
base64-simd = { version = "0.8", optional = true }
bytes = { version = "1", default-features = false, optional = true }
bytestring = { version = "1", optional = true }
charset = { version = "0.1", optional = true }
encoding_rs = { version = "0.8.35", optional = true }
chrono = { version = "0.4", default-features = false, features = ["clock", "serde", "wasmbind"], optional = true }
chrono-tz = { version = "0.10", default-features = false, optional = true }
ciborium = { version = "0.2.2", default-features = false, optional = true }
cidr = { version = "0.3", optional = true }
csv = { version = "1", optional = true }
clap = { workspace = true, optional = true }
codespan-reporting = { version = "0.13.1", optional = true }
convert_case = { version = "0.12.0", optional = true }
crc = { version = "3.3.0", optional = true }
digest = { version = "0.11", optional = true }
dyn-clone = { version = "1", default-features = false, optional = true }
exitcode = { version = "1", optional = true }
flate2 = { version = "1.1.2", default-features = false, features = ["zlib-rs"], optional = true }
hex = { version = "0.4", optional = true }
hmac = { version = "0.13", optional = true }
iana-time-zone = { version = "0.1", optional = true }
idna = { version = "1.0", optional = true }
indexmap = { version = "2", default-features = false, features = ["std"], optional = true }
influxdb-line-protocol = { version = "2.0.0", optional = true }
indoc = { version = "2", optional = true }
itertools = { version = "0.15", default-features = false, features = ["use_std"], optional = true }
lalrpop-util = { version = "0.23", optional = true }
mlua = { version = "0.11", default-features = false, features = ["lua54", "send", "vendored"], optional = true }
nom = { version = "8", default-features = false, features = ["std"], optional = true }
ordered-float = { version = "5", default-features = false, optional = true }
md-5 = { version = "0.11", optional = true }
parse-size = { version = "1.1.0", optional = true }
peeking_take_while = { version = "1", default-features = false, optional = true }
percent-encoding = { version = "2", optional = true }
pest = { version = "2", default-features = false, optional = true, features = ["std"] }
pest_derive = { version = "2", default-features = false, optional = true, features = ["std"] }
proptest = { version = "1", optional = true }
proptest-derive = { version = "0.9.0", optional = true }
prettydiff = { version = "0.9.0", default-features = false, optional = true }
prettytable-rs = { version = "0.10", default-features = false, optional = true }
quickcheck = { version = "1", optional = true }
quoted_printable = { version = "0.5", optional = true }
psl = { version = "2", optional = true }
psl-types = { version = "2", optional = true }
publicsuffix = { version = "2", optional = true }
rand = { version = "0.10", optional = true }
regex = { version = "1", default-features = false, optional = true, features = ["std", "perf", "unicode"] }
relative-path = { version = "2.0.1", optional = true }
roxmltree = { version = "0.21", optional = true }
rustyline = { version = "19.0.0", default-features = false, optional = true }
rust_decimal = { version = "1", optional = true, default-features = false }
seahash = { version = "4", optional = true }
serde = { version = "1", features = ["derive"], optional = true }
serde_json = { version = "1", default-features = false, optional = true, features = ["std", "raw_value"] }
serde_yaml_ng = { version = "0.10.0" }
simdutf8 = { version = "0.1.5", optional = true }
fancy-regex = { version = "0.20.0", default-features = false, optional = true }
sha1 = { version = "0.11", optional = true }
sha2 = { version = "0.11", optional = true }
sha3 = { version = "0.12", optional = true }
strip-ansi-escapes = { version = "0.2", optional = true }
snap = { version = "1", optional = true }
syslog_loose = { version = "0.23.0", optional = true }
termcolor = { version = "1", optional = true }
thiserror = { version = "2", optional = true }
tracing = { version = "0.1", default-features = false }
ua-parser = { version = "0.2", optional = true }
utf8-width = { version = "0.1", optional = true }
url = { version = "2", optional = true }
snafu = { version = "0.9", optional = true }
strum = { version = "0.28", optional = true }
strum_macros = { version = "0.28.0", optional = true }
webbrowser = { version = "1.0", default-features = false, optional = true }
woothee = { version = "0.13", optional = true }
xxhash-rust = { version = "0.8", optional = true, features = [
"xxh3",
"xxh32",
"xxh64",
] }
community-id = { version = "0.2", optional = true }
zstd = { version = "0.14.3", default-features = false, features = ["wasm"], optional = true }
# Cryptography
aes = { version = "0.9", optional = true }
# VRL supplies keys and IVs, so these ciphers do not need their random-generation features.
aes-siv = { version = "0.8.0", default-features = false, features = ["alloc"], optional = true }
chacha20poly1305 = { version = "0.11", optional = true }
crypto_secretbox = { version = "0.1", default-features = false, features = ["alloc", "salsa20"], optional = true }
ipcrypt-rs = { version = "0.10.0", optional = true, default-features = false }
# Cryptography - Block Modes
ctr = { version = "0.10", optional = true }
cbc = { version = "0.2", optional = true, features = ["alloc", "block-padding"] }
cfb-mode = { version = "0.9", optional = true }
ofb = { version = "0.7", optional = true }
# Protobuf support.
prost = { version = "0.14", default-features = false, optional = true, features = ["std"] }
prost-reflect = { version = "0.16", default-features = false, optional = true }
unicode-segmentation = "1.12.0"
lz4_flex = "0.14.0"
nom-language = { version = "0.1.0", default-features = false }
# Dependencies used for non-WASM
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# HTTP support (optional, gated behind enable_network_functions).
reqwest = { version = "0.13", default-features = false, features = ["http2", "rustls-no-provider"], optional = true }
# Use ring so VRL does not add a second rustls crypto provider to downstream builds.
rustls = { version = "0.23", default-features = false, features = ["ring", "std"], optional = true }
reqwest-middleware = { version = "0.5.2", default-features = false, optional = true }
reqwest-retry = { version = "0.9.1", default-features = false, optional = true }
dns-lookup = { version = "4.0.2", optional = true }
domain = { version = "0.12.3", optional = true, features = ["resolv-sync", "serde"] }
hostname = { version = "0.4", optional = true }
grok = { version = "2.4", optional = true }
onig = { version = "6", default-features = false, optional = true }
tokio = { version = "1.45", optional = true, features = ["io-util", "macros", "net", "time", "sync", "rt", "rt-multi-thread"] }
uuid = { version = "1", features = ["v4", "v7"], optional = true }
jsonschema = { version = "0.38.1", default-features = false }
# Dependencies used for WASM
[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { package = "getrandom", version = "0.4", features = ["wasm_js"] }
uuid = { version = "1", features = ["v4", "v7", "js"], optional = true }
[dev-dependencies]
anyhow = "1"
criterion = "0.8"
chrono-tz = "0.10"
serde_json = "1"
indoc = "2"
tracing-test = { version = "0.2", default-features = false }
mlua = { version = "0.11", default-features = false, features = ["lua54", "send", "vendored"] }
quickcheck = { version = "1" }
regex = { version = "1", default-features = false, features = ["std", "perf", "unicode"] }
constcat = "0.6"
pastey = { version = "0.2", default-features = false }
proptest = { version = "1" }
proptest-derive = { version = "0.9.0" }
[build-dependencies]
lalrpop = { version = "0.23", default-features = false }
serde_yaml_ng = "0.10"
ua-parser = { version = "0.2" }
[[bin]]
name = "vrl"
path = "src/main.rs"
required-features = ["cli", "stdlib"]
[[bench]]
name = "kind"
harness = false
[[bench]]
name = "keyvalue"
harness = false
[[bench]]
name = "stdlib"
harness = false
required-features = ["default", "test"]
[[bench]]
name = "for_each"
harness = false
[[bench]]
name = "layout"
harness = false
required-features = ["default", "test"]
[[bench]]
name = "large_objects"
harness = false
required-features = ["default", "test"]