1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use vector_lib::config::{log_schema, LogNamespace};
use vrl::owned_value_path;
use vrl::path::OwnedTargetPath;

pub mod optional;

pub(crate) fn get_message_path(log_namespace: LogNamespace) -> OwnedTargetPath {
    match log_namespace {
        LogNamespace::Vector => OwnedTargetPath::event(owned_value_path!()),
        LogNamespace::Legacy => OwnedTargetPath::event(
            log_schema()
                .message_key()
                .expect("global log_schema.message_key to be valid path")
                .clone(),
        ),
    }
}