vector_vrl_functions/
lib.rs1#![deny(warnings)]
11
12use vrl::{compiler::Function, path::OwnedTargetPath};
13
14pub mod get_secret;
15pub mod remove_secret;
16pub mod set_secret;
17pub mod set_semantic_meaning;
18
19#[allow(clippy::large_enum_variant)]
20#[derive(Clone, Debug)]
21pub enum MetadataKey {
22 Legacy(String),
23 Query(OwnedTargetPath),
24}
25
26pub const LEGACY_METADATA_KEYS: [&str; 2] = ["datadog_api_key", "splunk_hec_token"];
27
28pub fn secret_functions() -> Vec<Box<dyn Function>> {
30 vec![
31 Box::new(set_semantic_meaning::SetSemanticMeaning) as _,
32 Box::new(get_secret::GetSecret) as _,
33 Box::new(remove_secret::RemoveSecret) as _,
34 Box::new(set_secret::SetSecret) as _,
35 ]
36}
37
38#[allow(clippy::disallowed_methods)]
40pub fn all() -> Vec<Box<dyn Function>> {
41 let functions = vrl::stdlib::all()
42 .into_iter()
43 .chain(secret_functions())
44 .chain(enrichment::vrl_functions());
45
46 #[cfg(feature = "dnstap")]
47 let functions = functions.chain(dnstap_parser::vrl_functions());
48
49 #[cfg(feature = "vrl-metrics")]
50 let functions = functions.chain(vector_vrl_metrics::all());
51
52 functions.collect()
53}