From 164f1e9b716743569c3ede5ec5936a28a6882142 Mon Sep 17 00:00:00 2001 From: Bruce Guenter Date: Tue, 31 Oct 2023 11:04:25 -0600 Subject: [PATCH] chore(dev): Add wrapper for `lookup` in `vector-lib` (#18995) --- Cargo.lock | 2 +- Cargo.toml | 3 -- lib/vector-lib/Cargo.toml | 1 + lib/vector-lib/src/lib.rs | 1 + src/codecs/encoding/config.rs | 2 +- src/codecs/encoding/transformer.rs | 18 +++---- .../aws_cloudwatch_logs/integration_tests.rs | 1 + src/sinks/aws_kinesis/config.rs | 2 +- src/sinks/aws_kinesis/sink.rs | 2 +- src/sinks/aws_kinesis/streams/config.rs | 2 +- src/sinks/azure_monitor_logs/config.rs | 2 +- src/sinks/azure_monitor_logs/service.rs | 2 +- src/sinks/azure_monitor_logs/sink.rs | 2 +- src/sinks/clickhouse/integration_tests.rs | 11 ++--- src/sinks/datadog/events/request_builder.rs | 2 +- src/sinks/datadog/events/sink.rs | 2 +- src/sinks/datadog/logs/sink.rs | 2 +- src/sinks/elasticsearch/config.rs | 4 +- src/sinks/elasticsearch/sink.rs | 2 +- src/sinks/elasticsearch/tests.rs | 22 +++------ src/sinks/gcp/stackdriver/logs/config.rs | 2 +- src/sinks/gcp/stackdriver/logs/encoder.rs | 2 +- src/sinks/gcp/stackdriver/logs/tests.rs | 2 +- src/sinks/humio/logs.rs | 2 +- src/sinks/humio/metrics.rs | 3 +- src/sinks/humio/mod.rs | 2 +- src/sinks/influxdb/logs.rs | 8 ++-- src/sinks/kafka/config.rs | 2 +- src/sinks/kafka/request_builder.rs | 2 +- src/sinks/kafka/tests.rs | 2 +- src/sinks/loki/integration_tests.rs | 47 ++++--------------- src/sinks/loki/sink.rs | 26 +++------- src/sinks/pulsar/config.rs | 2 +- src/sinks/pulsar/tests.rs | 2 +- src/sinks/pulsar/util.rs | 2 +- src/sinks/splunk_hec/common/util.rs | 2 +- src/sinks/splunk_hec/logs/config.rs | 2 +- .../splunk_hec/logs/integration_tests.rs | 3 +- src/sinks/splunk_hec/logs/sink.rs | 2 +- src/sinks/splunk_hec/logs/tests.rs | 5 +- src/sinks/splunk_hec/metrics/config.rs | 2 +- .../splunk_hec/metrics/integration_tests.rs | 2 +- src/sources/amqp.rs | 4 +- src/sources/aws_kinesis_firehose/handlers.rs | 2 +- src/sources/aws_kinesis_firehose/mod.rs | 4 +- src/sources/aws_s3/mod.rs | 4 +- src/sources/aws_s3/sqs.rs | 2 +- src/sources/aws_sqs/config.rs | 2 +- src/sources/aws_sqs/source.rs | 2 +- src/sources/datadog_agent/logs.rs | 2 +- src/sources/datadog_agent/mod.rs | 2 +- src/sources/datadog_agent/tests.rs | 2 +- src/sources/demo_logs.rs | 2 +- src/sources/dnstap/mod.rs | 4 +- src/sources/dnstap/parser.rs | 4 +- src/sources/dnstap/schema.rs | 2 +- src/sources/docker_logs/mod.rs | 6 +-- src/sources/exec/mod.rs | 2 +- src/sources/file.rs | 4 +- .../file_descriptors/file_descriptor.rs | 4 +- src/sources/file_descriptors/mod.rs | 2 +- src/sources/file_descriptors/stdin.rs | 4 +- src/sources/fluent/mod.rs | 6 +-- src/sources/gcp_pubsub.rs | 4 +- src/sources/heroku_logs.rs | 4 +- src/sources/http_server.rs | 11 ++--- src/sources/internal_logs.rs | 6 +-- src/sources/internal_metrics.rs | 2 +- src/sources/journald.rs | 2 +- src/sources/kafka.rs | 4 +- src/sources/kubernetes_logs/mod.rs | 4 +- .../namespace_metadata_annotator.rs | 6 +-- .../node_metadata_annotator.rs | 6 +-- src/sources/kubernetes_logs/parser/cri.rs | 2 +- src/sources/kubernetes_logs/parser/docker.rs | 2 +- src/sources/kubernetes_logs/parser/mod.rs | 2 +- .../kubernetes_logs/parser/test_util.rs | 2 +- .../kubernetes_logs/partial_events_merger.rs | 2 +- .../kubernetes_logs/pod_metadata_annotator.rs | 8 ++-- src/sources/logstash.rs | 4 +- src/sources/nats.rs | 4 +- src/sources/opentelemetry/mod.rs | 2 +- src/sources/opentelemetry/tests.rs | 2 +- src/sources/redis/mod.rs | 2 +- src/sources/socket/mod.rs | 4 +- src/sources/socket/tcp.rs | 2 +- src/sources/socket/udp.rs | 2 +- src/sources/socket/unix.rs | 2 +- src/sources/splunk_hec/mod.rs | 4 +- src/sources/syslog.rs | 30 ++++-------- src/sources/util/framestream.rs | 4 +- src/sources/util/http/query.rs | 2 +- src/sources/util/message_decoding.rs | 2 +- src/sources/util/net/tcp/mod.rs | 2 +- src/sources/vector/mod.rs | 2 +- src/template.rs | 19 ++------ src/topology/schema.rs | 2 +- src/trace.rs | 2 +- src/transforms/aws_ec2_metadata.rs | 12 ++--- src/transforms/dedupe.rs | 4 +- src/transforms/metric_to_log.rs | 2 +- src/transforms/reduce/mod.rs | 6 +-- src/transforms/remap.rs | 2 +- 103 files changed, 188 insertions(+), 273 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7108a3b7923db..ccd015a475768 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9798,7 +9798,6 @@ dependencies = [ "url", "uuid", "vector-lib", - "vector-lookup", "vector-vrl-functions", "vrl", "warp", @@ -10053,6 +10052,7 @@ dependencies = [ "vector-common", "vector-config", "vector-core", + "vector-lookup", "vector-stream", ] diff --git a/Cargo.toml b/Cargo.toml index 53ae620ca846a..0e5e4083f12f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,7 +97,6 @@ members = [ "lib/k8s-e2e-tests", "lib/k8s-test-framework", "lib/loki-logproto", - "lib/vector-lookup", "lib/portpicker", "lib/prometheus-parser", "lib/opentelemetry-proto", @@ -131,7 +130,6 @@ pin-project.workspace = true # Internal libs dnsmsg-parser = { path = "lib/dnsmsg-parser", optional = true } fakedata = { path = "lib/fakedata", optional = true } -lookup = { package = "vector-lookup", path = "lib/vector-lookup" } portpicker = { path = "lib/portpicker" } tracing-limit = { path = "lib/tracing-limit" } vector-lib = { path = "lib/vector-lib", default-features = false, features = ["vrl"] } @@ -357,7 +355,6 @@ libc = "0.2.149" similar-asserts = "1.5.0" proptest = "1.3" quickcheck = "1.0.3" -lookup = { package = "vector-lookup", path = "lib/vector-lookup", features = ["test"] } reqwest = { version = "0.11", features = ["json"] } rstest = {version = "0.18.2"} tempfile = "3.8.1" diff --git a/lib/vector-lib/Cargo.toml b/lib/vector-lib/Cargo.toml index 9c63ef1c3cc43..d97a25a644a1d 100644 --- a/lib/vector-lib/Cargo.toml +++ b/lib/vector-lib/Cargo.toml @@ -16,6 +16,7 @@ vector-buffers = { path = "../vector-buffers", default-features = false } vector-common = { path = "../vector-common" } vector-config = { path = "../vector-config" } vector-core = { path = "../vector-core", default-features = false } +vector-lookup = { path = "../vector-lookup", features = ["test"] } vector-stream = { path = "../vector-stream" } [features] diff --git a/lib/vector-lib/src/lib.rs b/lib/vector-lib/src/lib.rs index 61bbe53de1d0c..5bc3d84d7f3e6 100644 --- a/lib/vector-lib/src/lib.rs +++ b/lib/vector-lib/src/lib.rs @@ -20,6 +20,7 @@ pub use vector_core::{ buckets, default_data_dir, event, fanout, metric_tags, metrics, partition, quantiles, samples, schema, serde, sink, source, tcp, tls, transform, update_counter, EstimatedJsonEncodedSizeOf, }; +pub use vector_lookup as lookup; pub use vector_stream as stream; pub mod config { diff --git a/src/codecs/encoding/config.rs b/src/codecs/encoding/config.rs index 5db46ad1e72fd..d16ec78b627e4 100644 --- a/src/codecs/encoding/config.rs +++ b/src/codecs/encoding/config.rs @@ -154,7 +154,7 @@ where #[cfg(test)] mod test { - use lookup::lookup_v2::{parse_value_path, ConfigValuePath}; + use vector_lib::lookup::lookup_v2::{parse_value_path, ConfigValuePath}; use super::*; use crate::codecs::encoding::TimestampFormat; diff --git a/src/codecs/encoding/transformer.rs b/src/codecs/encoding/transformer.rs index 126d526935699..237f6aa8ae1b6 100644 --- a/src/codecs/encoding/transformer.rs +++ b/src/codecs/encoding/transformer.rs @@ -4,12 +4,12 @@ use chrono::{DateTime, Utc}; use core::fmt::Debug; use std::collections::BTreeMap; -use lookup::lookup_v2::ConfigValuePath; -use lookup::{event_path, PathPrefix}; use ordered_float::NotNan; use serde::{Deserialize, Deserializer}; use vector_lib::configurable::configurable_component; use vector_lib::event::{LogEvent, MaybeAsLogMut}; +use vector_lib::lookup::lookup_v2::ConfigValuePath; +use vector_lib::lookup::{event_path, PathPrefix}; use vector_lib::schema::meaning; use vrl::path::OwnedValuePath; use vrl::value::Value; @@ -266,9 +266,9 @@ pub enum TimestampFormat { #[cfg(test)] mod tests { use indoc::indoc; - use lookup::path::parse_target_path; use vector_lib::btreemap; use vector_lib::config::{log_schema, LogNamespace}; + use vector_lib::lookup::path::parse_target_path; use vrl::value::Kind; use crate::config::schema; @@ -375,10 +375,7 @@ mod tests { let mut base = Event::Log(LogEvent::from("Demo")); let timestamp = base .as_mut_log() - .get(( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - )) + .get((PathPrefix::Event, log_schema().timestamp_key().unwrap())) .unwrap() .clone(); let timestamp = timestamp.as_timestamp().unwrap(); @@ -407,11 +404,8 @@ mod tests { for actual in [ // original key - log.get(( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - )) - .unwrap(), + log.get((PathPrefix::Event, log_schema().timestamp_key().unwrap())) + .unwrap(), // second key log.get("another").unwrap(), ] { diff --git a/src/sinks/aws_cloudwatch_logs/integration_tests.rs b/src/sinks/aws_cloudwatch_logs/integration_tests.rs index bafa29e32df89..3091cab25daea 100644 --- a/src/sinks/aws_cloudwatch_logs/integration_tests.rs +++ b/src/sinks/aws_cloudwatch_logs/integration_tests.rs @@ -6,6 +6,7 @@ use chrono::Duration; use futures::{stream, StreamExt}; use similar_asserts::assert_eq; use vector_lib::codecs::TextSerializerConfig; +use vector_lib::lookup; use super::*; use crate::aws::create_client; diff --git a/src/sinks/aws_kinesis/config.rs b/src/sinks/aws_kinesis/config.rs index 4fea310284a44..341063a0f2f19 100644 --- a/src/sinks/aws_kinesis/config.rs +++ b/src/sinks/aws_kinesis/config.rs @@ -1,5 +1,5 @@ -use lookup::lookup_v2::ConfigValuePath; use std::marker::PhantomData; +use vector_lib::lookup::lookup_v2::ConfigValuePath; use vector_lib::stream::BatcherSettings; diff --git a/src/sinks/aws_kinesis/sink.rs b/src/sinks/aws_kinesis/sink.rs index 6dfb0be08d19e..ea28d905fd8e2 100644 --- a/src/sinks/aws_kinesis/sink.rs +++ b/src/sinks/aws_kinesis/sink.rs @@ -1,7 +1,7 @@ use std::{borrow::Cow, fmt::Debug, marker::PhantomData}; -use lookup::lookup_v2::ConfigValuePath; use rand::random; +use vector_lib::lookup::lookup_v2::ConfigValuePath; use vrl::path::PathPrefix; use crate::{ diff --git a/src/sinks/aws_kinesis/streams/config.rs b/src/sinks/aws_kinesis/streams/config.rs index 3d975da3ab82d..1131e0cee2a87 100644 --- a/src/sinks/aws_kinesis/streams/config.rs +++ b/src/sinks/aws_kinesis/streams/config.rs @@ -3,9 +3,9 @@ use aws_sdk_kinesis::{ types::SdkError, }; use futures::FutureExt; -use lookup::lookup_v2::ConfigValuePath; use snafu::Snafu; use vector_lib::configurable::{component::GenerateConfig, configurable_component}; +use vector_lib::lookup::lookup_v2::ConfigValuePath; use crate::sinks::util::retries::RetryAction; use crate::{ diff --git a/src/sinks/azure_monitor_logs/config.rs b/src/sinks/azure_monitor_logs/config.rs index 1cd6b74414b19..e772fe53f762b 100644 --- a/src/sinks/azure_monitor_logs/config.rs +++ b/src/sinks/azure_monitor_logs/config.rs @@ -1,5 +1,5 @@ -use lookup::{lookup_v2::OptionalValuePath, OwnedValuePath}; use openssl::{base64, pkey}; +use vector_lib::lookup::{lookup_v2::OptionalValuePath, OwnedValuePath}; use vector_lib::configurable::configurable_component; use vector_lib::sensitive_string::SensitiveString; diff --git a/src/sinks/azure_monitor_logs/service.rs b/src/sinks/azure_monitor_logs/service.rs index 285edd09e9902..89702af0fd276 100644 --- a/src/sinks/azure_monitor_logs/service.rs +++ b/src/sinks/azure_monitor_logs/service.rs @@ -4,12 +4,12 @@ use http::{ HeaderName, HeaderValue, Request, StatusCode, Uri, }; use hyper::Body; -use lookup::lookup_v2::OwnedValuePath; use once_cell::sync::Lazy; use openssl::{base64, hash, pkey, sign}; use regex::Regex; use std::task::{Context, Poll}; use tracing::Instrument; +use vector_lib::lookup::lookup_v2::OwnedValuePath; use crate::{http::HttpClient, sinks::prelude::*}; diff --git a/src/sinks/azure_monitor_logs/sink.rs b/src/sinks/azure_monitor_logs/sink.rs index 75a2362c9ec7b..e916ebe7418da 100644 --- a/src/sinks/azure_monitor_logs/sink.rs +++ b/src/sinks/azure_monitor_logs/sink.rs @@ -1,8 +1,8 @@ use std::{fmt::Debug, io}; use bytes::Bytes; -use lookup::{OwnedValuePath, PathPrefix}; use vector_lib::codecs::{encoding::Framer, CharacterDelimitedEncoder, JsonSerializerConfig}; +use vector_lib::lookup::{OwnedValuePath, PathPrefix}; use crate::sinks::prelude::*; diff --git a/src/sinks/clickhouse/integration_tests.rs b/src/sinks/clickhouse/integration_tests.rs index 1a1bf060d1f18..05ee0ee4e333d 100644 --- a/src/sinks/clickhouse/integration_tests.rs +++ b/src/sinks/clickhouse/integration_tests.rs @@ -16,6 +16,7 @@ use serde::Deserialize; use serde_json::Value; use tokio::time::{timeout, Duration}; use vector_lib::event::{BatchNotifier, BatchStatus, BatchStatusReceiver, Event, LogEvent}; +use vector_lib::lookup::PathPrefix; use warp::Filter; use super::*; @@ -171,10 +172,7 @@ async fn insert_events_unix_timestamps() { let exp_event = input_event.as_mut_log(); exp_event.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), format!( "{}", exp_event @@ -232,10 +230,7 @@ timestamp_format = "unix""#, let exp_event = input_event.as_mut_log(); exp_event.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), format!( "{}", exp_event diff --git a/src/sinks/datadog/events/request_builder.rs b/src/sinks/datadog/events/request_builder.rs index 6e191bff02cdc..b2aa8bb1d7067 100644 --- a/src/sinks/datadog/events/request_builder.rs +++ b/src/sinks/datadog/events/request_builder.rs @@ -1,8 +1,8 @@ use std::{io, sync::Arc}; use bytes::Bytes; -use lookup::lookup_v2::ConfigValuePath; use vector_lib::codecs::JsonSerializerConfig; +use vector_lib::lookup::lookup_v2::ConfigValuePath; use vector_lib::request_metadata::{MetaDescriptive, RequestMetadata}; use vector_lib::ByteSizeOf; diff --git a/src/sinks/datadog/events/sink.rs b/src/sinks/datadog/events/sink.rs index d917a44c51bce..c2a5b4c018158 100644 --- a/src/sinks/datadog/events/sink.rs +++ b/src/sinks/datadog/events/sink.rs @@ -1,6 +1,6 @@ use std::fmt; -use lookup::event_path; +use vector_lib::lookup::event_path; use crate::{ internal_events::{ParserMissingFieldError, DROP_EVENT}, diff --git a/src/sinks/datadog/logs/sink.rs b/src/sinks/datadog/logs/sink.rs index 4a422826102af..0e73e8495e7e9 100644 --- a/src/sinks/datadog/logs/sink.rs +++ b/src/sinks/datadog/logs/sink.rs @@ -1,9 +1,9 @@ use std::{fmt::Debug, io, sync::Arc}; use bytes::Bytes; -use lookup::event_path; use snafu::Snafu; use vector_lib::codecs::{encoding::Framer, CharacterDelimitedEncoder, JsonSerializerConfig}; +use vector_lib::lookup::event_path; use super::{config::MAX_PAYLOAD_BYTES, service::LogApiRequest}; use crate::sinks::{ diff --git a/src/sinks/elasticsearch/config.rs b/src/sinks/elasticsearch/config.rs index 04fe7776ded0f..a5d983622810e 100644 --- a/src/sinks/elasticsearch/config.rs +++ b/src/sinks/elasticsearch/config.rs @@ -31,8 +31,8 @@ use crate::{ tls::TlsConfig, transforms::metric_to_log::MetricToLogConfig, }; -use lookup::event_path; -use lookup::lookup_v2::ConfigValuePath; +use vector_lib::lookup::event_path; +use vector_lib::lookup::lookup_v2::ConfigValuePath; use vector_lib::schema::Requirement; use vrl::value::Kind; diff --git a/src/sinks/elasticsearch/sink.rs b/src/sinks/elasticsearch/sink.rs index 5d3c043e233ce..78c33b774b2ff 100644 --- a/src/sinks/elasticsearch/sink.rs +++ b/src/sinks/elasticsearch/sink.rs @@ -1,6 +1,6 @@ use std::fmt; -use lookup::lookup_v2::ConfigValuePath; +use vector_lib::lookup::lookup_v2::ConfigValuePath; use vrl::path::PathPrefix; use crate::{ diff --git a/src/sinks/elasticsearch/tests.rs b/src/sinks/elasticsearch/tests.rs index f8a8a55ac7882..b1688cf65e5ba 100644 --- a/src/sinks/elasticsearch/tests.rs +++ b/src/sinks/elasticsearch/tests.rs @@ -1,5 +1,7 @@ use std::{collections::BTreeMap, convert::TryFrom}; +use vector_lib::lookup::PathPrefix; + use crate::{ codecs::Transformer, event::{LogEvent, Metric, MetricKind, MetricValue, Value}, @@ -37,10 +39,7 @@ async fn sets_create_action_when_configured() { let mut log = LogEvent::from("hello there"); log.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), Utc.with_ymd_and_hms(2020, 12, 1, 1, 2, 3) .single() .expect("invalid timestamp"), @@ -106,10 +105,7 @@ async fn encode_datastream_mode() { let mut log = LogEvent::from("hello there"); log.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), Utc.with_ymd_and_hms(2020, 12, 1, 1, 2, 3) .single() .expect("invalid timestamp"), @@ -173,10 +169,7 @@ async fn encode_datastream_mode_no_routing() { ), ); log.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), Utc.with_ymd_and_hms(2020, 12, 1, 1, 2, 3) .single() .expect("invalid timestamp"), @@ -324,10 +317,7 @@ async fn encode_datastream_mode_no_sync() { ), ); log.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), Utc.with_ymd_and_hms(2020, 12, 1, 1, 2, 3) .single() .expect("invalid timestamp"), diff --git a/src/sinks/gcp/stackdriver/logs/config.rs b/src/sinks/gcp/stackdriver/logs/config.rs index 71adf3d0ef778..9e3a82eb4c3b5 100644 --- a/src/sinks/gcp/stackdriver/logs/config.rs +++ b/src/sinks/gcp/stackdriver/logs/config.rs @@ -15,9 +15,9 @@ use crate::{ }; use http::{Request, Uri}; use hyper::Body; -use lookup::lookup_v2::ConfigValuePath; use snafu::Snafu; use std::collections::HashMap; +use vector_lib::lookup::lookup_v2::ConfigValuePath; use vrl::value::Kind; use super::{ diff --git a/src/sinks/gcp/stackdriver/logs/encoder.rs b/src/sinks/gcp/stackdriver/logs/encoder.rs index 00888cf35997f..e289070c3dbb7 100644 --- a/src/sinks/gcp/stackdriver/logs/encoder.rs +++ b/src/sinks/gcp/stackdriver/logs/encoder.rs @@ -3,8 +3,8 @@ use std::{collections::HashMap, io}; use bytes::BytesMut; -use lookup::lookup_v2::ConfigValuePath; use serde_json::{json, to_vec, Map}; +use vector_lib::lookup::lookup_v2::ConfigValuePath; use vrl::path::PathPrefix; use crate::{ diff --git a/src/sinks/gcp/stackdriver/logs/tests.rs b/src/sinks/gcp/stackdriver/logs/tests.rs index ee56c7d1c5424..dee3db2dfd610 100644 --- a/src/sinks/gcp/stackdriver/logs/tests.rs +++ b/src/sinks/gcp/stackdriver/logs/tests.rs @@ -5,9 +5,9 @@ use chrono::{TimeZone, Utc}; use futures::{future::ready, stream}; use http::Uri; use indoc::indoc; -use lookup::lookup_v2::ConfigValuePath; use serde::Deserialize; use std::collections::HashMap; +use vector_lib::lookup::lookup_v2::ConfigValuePath; use crate::{ config::{GenerateConfig, SinkConfig, SinkContext}, diff --git a/src/sinks/humio/logs.rs b/src/sinks/humio/logs.rs index ddb78d12090c2..552eab36d7214 100644 --- a/src/sinks/humio/logs.rs +++ b/src/sinks/humio/logs.rs @@ -1,6 +1,6 @@ -use lookup::lookup_v2::{ConfigValuePath, OptionalValuePath}; use vector_lib::codecs::JsonSerializerConfig; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::lookup_v2::{ConfigValuePath, OptionalValuePath}; use vector_lib::sensitive_string::SensitiveString; use super::config_host_key; diff --git a/src/sinks/humio/metrics.rs b/src/sinks/humio/metrics.rs index 63af0ffd72366..75b8a661703b0 100644 --- a/src/sinks/humio/metrics.rs +++ b/src/sinks/humio/metrics.rs @@ -2,9 +2,10 @@ use async_trait::async_trait; use futures::StreamExt; use futures_util::stream::BoxStream; use indoc::indoc; -use lookup::lookup_v2::{ConfigValuePath, OptionalValuePath}; use vector_lib::codecs::JsonSerializerConfig; use vector_lib::configurable::configurable_component; +use vector_lib::lookup; +use vector_lib::lookup::lookup_v2::{ConfigValuePath, OptionalValuePath}; use vector_lib::sensitive_string::SensitiveString; use vector_lib::sink::StreamSink; diff --git a/src/sinks/humio/mod.rs b/src/sinks/humio/mod.rs index 5a4f4f88582f2..7bca299c99ead 100644 --- a/src/sinks/humio/mod.rs +++ b/src/sinks/humio/mod.rs @@ -1,4 +1,4 @@ -use lookup::lookup_v2::OptionalValuePath; +use vector_lib::lookup::lookup_v2::OptionalValuePath; pub mod logs; pub mod metrics; diff --git a/src/sinks/influxdb/logs.rs b/src/sinks/influxdb/logs.rs index 38003349f2923..e668191dbf224 100644 --- a/src/sinks/influxdb/logs.rs +++ b/src/sinks/influxdb/logs.rs @@ -8,10 +8,10 @@ use vrl::event_path; use vrl::path::OwnedValuePath; use vrl::value::Kind; -use lookup::lookup_v2::OptionalValuePath; -use lookup::PathPrefix; use vector_lib::config::log_schema; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::lookup_v2::OptionalValuePath; +use vector_lib::lookup::PathPrefix; use vector_lib::schema; use crate::{ @@ -403,8 +403,8 @@ mod tests { use http::{request::Parts, StatusCode}; use indoc::indoc; - use lookup::owned_value_path; use vector_lib::event::{BatchNotifier, BatchStatus, Event, LogEvent}; + use vector_lib::lookup::owned_value_path; use crate::{ sinks::{ @@ -881,10 +881,10 @@ mod integration_tests { use futures::stream; use vrl::value; - use lookup::{owned_value_path, path}; use vector_lib::codecs::BytesDeserializerConfig; use vector_lib::config::{LegacyKey, LogNamespace}; use vector_lib::event::{BatchNotifier, BatchStatus, Event, LogEvent}; + use vector_lib::lookup::{owned_value_path, path}; use crate::{ config::SinkContext, diff --git a/src/sinks/kafka/config.rs b/src/sinks/kafka/config.rs index b527b9ccee4a1..0ddfc4dca27e2 100644 --- a/src/sinks/kafka/config.rs +++ b/src/sinks/kafka/config.rs @@ -1,11 +1,11 @@ use std::{collections::HashMap, time::Duration}; use futures::FutureExt; -use lookup::lookup_v2::ConfigTargetPath; use rdkafka::ClientConfig; use serde_with::serde_as; use vector_lib::codecs::JsonSerializerConfig; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::lookup_v2::ConfigTargetPath; use vrl::value::Kind; use crate::{ diff --git a/src/sinks/kafka/request_builder.rs b/src/sinks/kafka/request_builder.rs index 7a7693a35b032..60cebfe51fbeb 100644 --- a/src/sinks/kafka/request_builder.rs +++ b/src/sinks/kafka/request_builder.rs @@ -1,6 +1,6 @@ use bytes::Bytes; -use lookup::OwnedTargetPath; use rdkafka::message::{Header, OwnedHeaders}; +use vector_lib::lookup::OwnedTargetPath; use crate::{ internal_events::KafkaHeaderExtractionError, diff --git a/src/sinks/kafka/tests.rs b/src/sinks/kafka/tests.rs index 2ef2ce55ccd28..3b8d4bd62037c 100644 --- a/src/sinks/kafka/tests.rs +++ b/src/sinks/kafka/tests.rs @@ -12,13 +12,13 @@ mod integration_test { use bytes::Bytes; use futures::StreamExt; - use lookup::lookup_v2::ConfigTargetPath; use rdkafka::{ consumer::{BaseConsumer, Consumer}, message::Headers, Message, Offset, TopicPartitionList, }; use vector_lib::codecs::TextSerializerConfig; + use vector_lib::lookup::lookup_v2::ConfigTargetPath; use vector_lib::{ config::{init_telemetry, Tags, Telemetry}, event::{BatchNotifier, BatchStatus}, diff --git a/src/sinks/loki/integration_tests.rs b/src/sinks/loki/integration_tests.rs index 3fb9f66ca6481..ccd179ef51466 100644 --- a/src/sinks/loki/integration_tests.rs +++ b/src/sinks/loki/integration_tests.rs @@ -4,8 +4,8 @@ use std::sync::Arc; use bytes::Bytes; use chrono::{DateTime, Duration, Utc}; use futures::stream; -use lookup::owned_value_path; use vector_lib::encode_logfmt; +use vector_lib::lookup::{owned_value_path, PathPrefix}; use vector_lib::{ config::{init_telemetry, LogNamespace, Tags, Telemetry}, event::{BatchNotifier, BatchStatus, Event, LogEvent}, @@ -497,19 +497,13 @@ async fn out_of_order_drop() { for (i, event) in events.iter_mut().enumerate() { let log = event.as_mut_log(); log.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), base + Duration::seconds(i as i64), ); } // first event of the second batch is out-of-order. events[batch_size].as_mut_log().insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), base, ); @@ -533,19 +527,13 @@ async fn out_of_order_accept() { for (i, event) in events.iter_mut().enumerate() { let log = event.as_mut_log(); log.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), base + Duration::seconds(i as i64), ); } // first event of the second batch is out-of-order. events[batch_size].as_mut_log().insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), base - Duration::seconds(1), ); @@ -571,19 +559,13 @@ async fn out_of_order_rewrite() { for (i, event) in events.iter_mut().enumerate() { let log = event.as_mut_log(); log.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), base + Duration::seconds(i as i64), ); } // first event of the second batch is out-of-order. events[batch_size].as_mut_log().insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), base, ); @@ -591,10 +573,7 @@ async fn out_of_order_rewrite() { let time = get_timestamp(&expected[batch_size - 1]); // timestamp is rewritten with latest timestamp of the first batch expected[batch_size].as_mut_log().insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), time, ); @@ -622,10 +601,7 @@ async fn out_of_order_per_partition() { for (i, event) in events.iter_mut().enumerate() { let log = event.as_mut_log(); log.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), base + Duration::seconds(i as i64), ); } @@ -692,10 +668,7 @@ async fn test_out_of_order_events( fn get_timestamp(event: &Event) -> DateTime { *event .as_log() - .get(( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - )) + .get((PathPrefix::Event, log_schema().timestamp_key().unwrap())) .unwrap() .as_timestamp() .unwrap() diff --git a/src/sinks/loki/sink.rs b/src/sinks/loki/sink.rs index 6c0d5f05ef7a5..a9c1a1cc5b092 100644 --- a/src/sinks/loki/sink.rs +++ b/src/sinks/loki/sink.rs @@ -523,6 +523,7 @@ mod tests { use futures::stream::StreamExt; use vector_lib::codecs::JsonSerializerConfig; use vector_lib::event::{Event, LogEvent, Value}; + use vector_lib::lookup::PathPrefix; use super::{EventEncoder, KeyPartitioner, RecordFilter}; use crate::{ @@ -543,10 +544,7 @@ mod tests { let mut event = Event::Log(LogEvent::from("hello world")); let log = event.as_mut_log(); log.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), chrono::Utc::now(), ); let record = encoder.encode_event(event).unwrap(); @@ -589,10 +587,7 @@ mod tests { let mut event = Event::Log(LogEvent::from("hello world")); let log = event.as_mut_log(); log.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), chrono::Utc::now(), ); log.insert("name", "foo"); @@ -751,10 +746,7 @@ mod tests { let mut event = Event::Log(LogEvent::from("hello world")); let log = event.as_mut_log(); log.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), chrono::Utc::now(), ); let record = encoder.encode_event(event).unwrap(); @@ -784,10 +776,7 @@ mod tests { let mut event = Event::Log(LogEvent::from("hello world")); let log = event.as_mut_log(); log.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), chrono::Utc::now(), ); log.insert("name", "foo"); @@ -819,10 +808,7 @@ mod tests { base + chrono::Duration::seconds(i as i64) }; log.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), ts, ); event diff --git a/src/sinks/pulsar/config.rs b/src/sinks/pulsar/config.rs index 8f8c4a4a1c194..4f69ef9831a5a 100644 --- a/src/sinks/pulsar/config.rs +++ b/src/sinks/pulsar/config.rs @@ -6,7 +6,6 @@ use crate::{ }, }; use futures_util::FutureExt; -use lookup::lookup_v2::OptionalTargetPath; use pulsar::{ authentication::oauth2::{OAuth2Authentication, OAuth2Params}, compression, @@ -18,6 +17,7 @@ use pulsar::{error::AuthenticationError, OperationRetryOptions}; use snafu::ResultExt; use vector_lib::codecs::{encoding::SerializerConfig, TextSerializerConfig}; use vector_lib::config::DataType; +use vector_lib::lookup::lookup_v2::OptionalTargetPath; use vector_lib::sensitive_string::SensitiveString; use vrl::value::Kind; diff --git a/src/sinks/pulsar/tests.rs b/src/sinks/pulsar/tests.rs index 1fbee5cba0eec..3c6d8da9e608f 100644 --- a/src/sinks/pulsar/tests.rs +++ b/src/sinks/pulsar/tests.rs @@ -1,8 +1,8 @@ use crate::event::Event; use crate::sinks::pulsar::config::PulsarSinkConfig; -use lookup::lookup_v2::OptionalTargetPath; use std::collections::BTreeMap; use vector_lib::configurable::component::GenerateConfig; +use vector_lib::lookup::lookup_v2::OptionalTargetPath; use vrl::value::Value; use bytes::Bytes; diff --git a/src/sinks/pulsar/util.rs b/src/sinks/pulsar/util.rs index 120782f6af3f3..9ae2b584f3683 100644 --- a/src/sinks/pulsar/util.rs +++ b/src/sinks/pulsar/util.rs @@ -3,9 +3,9 @@ use crate::sinks::pulsar::config::PulsarSinkConfig; use crate::sinks::pulsar::sink::PulsarEvent; use crate::template::Template; use bytes::Bytes; -use lookup::lookup_v2::OptionalTargetPath; use std::collections::HashMap; use vector_lib::event::Event; +use vector_lib::lookup::lookup_v2::OptionalTargetPath; use vrl::value::Value; /// Transforms an event into a Pulsar event by rendering the required template fields. diff --git a/src/sinks/splunk_hec/common/util.rs b/src/sinks/splunk_hec/common/util.rs index 6fc513b788143..49c4b5f4f2636 100644 --- a/src/sinks/splunk_hec/common/util.rs +++ b/src/sinks/splunk_hec/common/util.rs @@ -4,8 +4,8 @@ use bytes::Bytes; use futures_util::future::BoxFuture; use http::{Request, StatusCode, Uri}; use hyper::Body; -use lookup::lookup_v2::OptionalValuePath; use snafu::{ResultExt, Snafu}; +use vector_lib::lookup::lookup_v2::OptionalValuePath; use vector_lib::{config::proxy::ProxyConfig, event::EventRef}; use super::{ diff --git a/src/sinks/splunk_hec/logs/config.rs b/src/sinks/splunk_hec/logs/config.rs index 862830ccf7b81..2bd2515f237c0 100644 --- a/src/sinks/splunk_hec/logs/config.rs +++ b/src/sinks/splunk_hec/logs/config.rs @@ -1,10 +1,10 @@ use std::sync::Arc; use futures_util::FutureExt; -use lookup::lookup_v2::{ConfigValuePath, OptionalValuePath}; use tower::ServiceBuilder; use vector_lib::codecs::TextSerializerConfig; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::lookup_v2::{ConfigValuePath, OptionalValuePath}; use vector_lib::sensitive_string::SensitiveString; use vector_lib::sink::VectorSink; diff --git a/src/sinks/splunk_hec/logs/integration_tests.rs b/src/sinks/splunk_hec/logs/integration_tests.rs index 5bdf697fe4a15..aea4e0dd8d374 100644 --- a/src/sinks/splunk_hec/logs/integration_tests.rs +++ b/src/sinks/splunk_hec/logs/integration_tests.rs @@ -2,13 +2,14 @@ use std::{convert::TryFrom, iter, num::NonZeroU8}; use chrono::{TimeZone, Timelike, Utc}; use futures::{future::ready, stream}; -use lookup::lookup_v2::{ConfigValuePath, OptionalValuePath}; use serde_json::Value as JsonValue; use tokio::time::{sleep, Duration}; use vector_lib::codecs::{JsonSerializerConfig, TextSerializerConfig}; +use vector_lib::lookup::lookup_v2::{ConfigValuePath, OptionalValuePath}; use vector_lib::{ config::{init_telemetry, Tags, Telemetry}, event::{BatchNotifier, BatchStatus, Event, LogEvent}, + lookup, }; use crate::{ diff --git a/src/sinks/splunk_hec/logs/sink.rs b/src/sinks/splunk_hec/logs/sink.rs index 7fed3bf3310e0..2e9b3e75e18ec 100644 --- a/src/sinks/splunk_hec/logs/sink.rs +++ b/src/sinks/splunk_hec/logs/sink.rs @@ -15,7 +15,7 @@ use crate::{ util::processed_event::ProcessedEvent, }, }; -use lookup::{event_path, OwnedValuePath, PathPrefix}; +use vector_lib::lookup::{event_path, OwnedValuePath, PathPrefix}; pub struct HecLogsSink { pub context: SinkContext, diff --git a/src/sinks/splunk_hec/logs/tests.rs b/src/sinks/splunk_hec/logs/tests.rs index 51270163e5823..d75414f9cd068 100644 --- a/src/sinks/splunk_hec/logs/tests.rs +++ b/src/sinks/splunk_hec/logs/tests.rs @@ -2,13 +2,14 @@ use std::{collections::BTreeMap, sync::Arc}; use chrono::{TimeZone, Utc}; use futures_util::StreamExt; -use lookup::lookup_v2::OptionalValuePath; -use lookup::{OwnedValuePath, PathPrefix}; use serde::Deserialize; use vector_lib::codecs::{JsonSerializerConfig, TextSerializerConfig}; +use vector_lib::lookup::lookup_v2::OptionalValuePath; +use vector_lib::lookup::{OwnedValuePath, PathPrefix}; use vector_lib::{ config::log_schema, event::{Event, LogEvent, Value}, + lookup, }; use vrl::owned_value_path; diff --git a/src/sinks/splunk_hec/metrics/config.rs b/src/sinks/splunk_hec/metrics/config.rs index 832c8da762421..cc64656c68aff 100644 --- a/src/sinks/splunk_hec/metrics/config.rs +++ b/src/sinks/splunk_hec/metrics/config.rs @@ -1,9 +1,9 @@ use std::sync::Arc; use futures_util::FutureExt; -use lookup::lookup_v2::OptionalValuePath; use tower::ServiceBuilder; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::lookup_v2::OptionalValuePath; use vector_lib::sensitive_string::SensitiveString; use vector_lib::sink::VectorSink; diff --git a/src/sinks/splunk_hec/metrics/integration_tests.rs b/src/sinks/splunk_hec/metrics/integration_tests.rs index 74fb8ad45ed61..9111cd0a350b4 100644 --- a/src/sinks/splunk_hec/metrics/integration_tests.rs +++ b/src/sinks/splunk_hec/metrics/integration_tests.rs @@ -1,8 +1,8 @@ use std::convert::TryFrom; use futures::{future::ready, stream}; -use lookup::lookup_v2::OptionalValuePath; use serde_json::Value as JsonValue; +use vector_lib::lookup::lookup_v2::OptionalValuePath; use vector_lib::{ config::{init_telemetry, Tags, Telemetry}, event::{BatchNotifier, BatchStatus, Event, MetricValue}, diff --git a/src/sources/amqp.rs b/src/sources/amqp.rs index f9da0019a4cd7..8c83d2a9536ff 100644 --- a/src/sources/amqp.rs +++ b/src/sources/amqp.rs @@ -19,12 +19,12 @@ use chrono::{TimeZone, Utc}; use futures::{FutureExt, StreamExt}; use futures_util::Stream; use lapin::{acker::Acker, message::Delivery, Channel}; -use lookup::{lookup_v2::OptionalValuePath, metadata_path, owned_value_path, path}; use snafu::Snafu; use std::{io::Cursor, pin::Pin}; use tokio_util::codec::FramedRead; use vector_lib::codecs::decoding::{DeserializerConfig, FramingConfig}; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::{lookup_v2::OptionalValuePath, metadata_path, owned_value_path, path}; use vector_lib::{ config::{log_schema, LegacyKey, LogNamespace, SourceAcknowledgementsConfig}, event::Event, @@ -492,7 +492,7 @@ async fn handle_ack(status: BatchStatus, entry: FinalizerEntry) { #[cfg(test)] pub mod test { - use lookup::OwnedTargetPath; + use vector_lib::lookup::OwnedTargetPath; use vector_lib::schema::Definition; use vector_lib::tls::TlsConfig; use vrl::value::kind::Collection; diff --git a/src/sources/aws_kinesis_firehose/handlers.rs b/src/sources/aws_kinesis_firehose/handlers.rs index 6d4e6e1cf246b..3b81662d542b8 100644 --- a/src/sources/aws_kinesis_firehose/handlers.rs +++ b/src/sources/aws_kinesis_firehose/handlers.rs @@ -5,10 +5,10 @@ use bytes::Bytes; use chrono::Utc; use flate2::read::MultiGzDecoder; use futures::StreamExt; -use lookup::{metadata_path, path, PathPrefix}; use snafu::{ResultExt, Snafu}; use tokio_util::codec::FramedRead; use vector_lib::codecs::StreamDecodingError; +use vector_lib::lookup::{metadata_path, path, PathPrefix}; use vector_lib::{ config::{LegacyKey, LogNamespace}, event::BatchNotifier, diff --git a/src/sources/aws_kinesis_firehose/mod.rs b/src/sources/aws_kinesis_firehose/mod.rs index f867085d70764..0821a09d26396 100644 --- a/src/sources/aws_kinesis_firehose/mod.rs +++ b/src/sources/aws_kinesis_firehose/mod.rs @@ -2,12 +2,12 @@ use std::{convert::Infallible, fmt, net::SocketAddr}; use futures::FutureExt; use hyper::{service::make_service_fn, Server}; -use lookup::owned_value_path; use tower::ServiceBuilder; use tracing::Span; use vector_lib::codecs::decoding::{DeserializerConfig, FramingConfig}; use vector_lib::config::{LegacyKey, LogNamespace}; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::owned_value_path; use vector_lib::sensitive_string::SensitiveString; use vrl::value::Kind; @@ -263,10 +263,10 @@ mod tests { use chrono::{DateTime, SubsecRound, Utc}; use flate2::read::GzEncoder; use futures::Stream; - use lookup::path; use similar_asserts::assert_eq; use tokio::time::{sleep, Duration}; use vector_lib::assert_event_data_eq; + use vector_lib::lookup::path; use vrl::value; use super::*; diff --git a/src/sources/aws_s3/mod.rs b/src/sources/aws_s3/mod.rs index 2c58bebbb281a..494d0efbd0c72 100644 --- a/src/sources/aws_s3/mod.rs +++ b/src/sources/aws_s3/mod.rs @@ -3,7 +3,6 @@ use std::{convert::TryInto, io::ErrorKind}; use async_compression::tokio::bufread; use aws_sdk_s3::types::ByteStream; use futures::{stream, stream::StreamExt, TryStreamExt}; -use lookup::owned_value_path; use snafu::Snafu; use tokio_util::io::StreamReader; use vector_lib::codecs::decoding::{ @@ -12,6 +11,7 @@ use vector_lib::codecs::decoding::{ use vector_lib::codecs::NewlineDelimitedDecoderConfig; use vector_lib::config::{LegacyKey, LogNamespace}; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::owned_value_path; use vrl::value::{kind::Collection, Kind}; use super::util::MultilineConfig; @@ -445,9 +445,9 @@ mod integration_tests { use aws_sdk_s3::{types::ByteStream, Client as S3Client}; use aws_sdk_sqs::{model::QueueAttributeName, Client as SqsClient}; - use lookup::path; use similar_asserts::assert_eq; use vector_lib::codecs::{decoding::DeserializerConfig, JsonDeserializerConfig}; + use vector_lib::lookup::path; use vrl::value::Value; use super::{sqs, AwsS3Config, Compression, Strategy}; diff --git a/src/sources/aws_s3/sqs.rs b/src/sources/aws_s3/sqs.rs index f44f14693ca34..9633f800949b1 100644 --- a/src/sources/aws_s3/sqs.rs +++ b/src/sources/aws_s3/sqs.rs @@ -44,9 +44,9 @@ use crate::{ tls::TlsConfig, SourceSender, }; -use lookup::{metadata_path, path, PathPrefix}; use vector_lib::config::{log_schema, LegacyKey, LogNamespace}; use vector_lib::event::MaybeAsLogMut; +use vector_lib::lookup::{metadata_path, path, PathPrefix}; static SUPPORTED_S3_EVENT_VERSION: Lazy = Lazy::new(|| semver::VersionReq::parse("~2").unwrap()); diff --git a/src/sources/aws_sqs/config.rs b/src/sources/aws_sqs/config.rs index 0859f7d238fa2..7053912290e7c 100644 --- a/src/sources/aws_sqs/config.rs +++ b/src/sources/aws_sqs/config.rs @@ -1,9 +1,9 @@ use std::num::NonZeroUsize; -use lookup::owned_value_path; use vector_lib::codecs::decoding::{DeserializerConfig, FramingConfig}; use vector_lib::config::{LegacyKey, LogNamespace}; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::owned_value_path; use vrl::value::Kind; use crate::aws::create_client; diff --git a/src/sources/aws_sqs/source.rs b/src/sources/aws_sqs/source.rs index c463e38cd7074..832189c19cfc1 100644 --- a/src/sources/aws_sqs/source.rs +++ b/src/sources/aws_sqs/source.rs @@ -224,7 +224,7 @@ mod tests { use crate::config::{log_schema, SourceConfig}; use crate::sources::aws_sqs::AwsSqsConfig; use chrono::SecondsFormat; - use lookup::path; + use vector_lib::lookup::path; #[tokio::test] async fn test_decode_vector_namespace() { diff --git a/src/sources/datadog_agent/logs.rs b/src/sources/datadog_agent/logs.rs index 400e966f5ce36..8be7cb8a391f3 100644 --- a/src/sources/datadog_agent/logs.rs +++ b/src/sources/datadog_agent/logs.rs @@ -3,10 +3,10 @@ use std::sync::Arc; use bytes::{BufMut, Bytes, BytesMut}; use chrono::Utc; use http::StatusCode; -use lookup::path; use tokio_util::codec::Decoder; use vector_lib::codecs::StreamDecodingError; use vector_lib::internal_event::{CountByteSize, InternalEventHandle as _}; +use vector_lib::lookup::path; use vector_lib::{config::LegacyKey, EstimatedJsonEncodedSizeOf}; use warp::{filters::BoxedFilter, path as warp_path, path::FullPath, reply::Response, Filter}; diff --git a/src/sources/datadog_agent/mod.rs b/src/sources/datadog_agent/mod.rs index cc8b76a9216a6..ba4ac56f7997a 100644 --- a/src/sources/datadog_agent/mod.rs +++ b/src/sources/datadog_agent/mod.rs @@ -27,7 +27,6 @@ use futures::FutureExt; use http::StatusCode; use hyper::service::make_service_fn; use hyper::Server; -use lookup::owned_value_path; use regex::Regex; use serde::{Deserialize, Serialize}; use snafu::Snafu; @@ -38,6 +37,7 @@ use vector_lib::config::{LegacyKey, LogNamespace}; use vector_lib::configurable::configurable_component; use vector_lib::event::{BatchNotifier, BatchStatus}; use vector_lib::internal_event::{EventsReceived, Registered}; +use vector_lib::lookup::owned_value_path; use vrl::path::OwnedTargetPath; use vrl::value::Kind; use warp::{filters::BoxedFilter, reject::Rejection, reply::Response, Filter, Reply}; diff --git a/src/sources/datadog_agent/tests.rs b/src/sources/datadog_agent/tests.rs index 87d0a465f984a..657a59c8067db 100644 --- a/src/sources/datadog_agent/tests.rs +++ b/src/sources/datadog_agent/tests.rs @@ -10,7 +10,6 @@ use chrono::{TimeZone, Utc}; use futures::{Stream, StreamExt}; use http::HeaderMap; use indoc::indoc; -use lookup::{owned_value_path, OwnedTargetPath}; use ordered_float::NotNan; use prost::Message; use quickcheck::{Arbitrary, Gen, QuickCheck, TestResult}; @@ -19,6 +18,7 @@ use vector_lib::codecs::{ decoding::{Deserializer, DeserializerConfig, Framer}, BytesDecoder, BytesDeserializer, }; +use vector_lib::lookup::{owned_value_path, OwnedTargetPath}; use vector_lib::{ config::LogNamespace, event::{metric::TagValue, MetricTags}, diff --git a/src/sources/demo_logs.rs b/src/sources/demo_logs.rs index d318dbf8acc21..6460147fe6c23 100644 --- a/src/sources/demo_logs.rs +++ b/src/sources/demo_logs.rs @@ -1,7 +1,6 @@ use chrono::Utc; use fakedata::logs::*; use futures::StreamExt; -use lookup::{owned_value_path, path}; use rand::seq::SliceRandom; use serde_with::serde_as; use snafu::Snafu; @@ -16,6 +15,7 @@ use vector_lib::configurable::configurable_component; use vector_lib::internal_event::{ ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Protocol, }; +use vector_lib::lookup::{owned_value_path, path}; use vector_lib::{ config::{LegacyKey, LogNamespace}, EstimatedJsonEncodedSizeOf, diff --git a/src/sources/dnstap/mod.rs b/src/sources/dnstap/mod.rs index 34c30ee675201..8973ca8bac9db 100644 --- a/src/sources/dnstap/mod.rs +++ b/src/sources/dnstap/mod.rs @@ -2,11 +2,11 @@ use std::path::PathBuf; use base64::prelude::{Engine as _, BASE64_STANDARD}; use bytes::Bytes; -use lookup::{owned_value_path, path, OwnedValuePath}; use vector_lib::configurable::configurable_component; use vector_lib::internal_event::{ ByteSize, BytesReceived, InternalEventHandle as _, Protocol, Registered, }; +use vector_lib::lookup::{owned_value_path, path, OwnedValuePath}; use vrl::path::PathPrefix; use vrl::value::{kind::Collection, Kind}; @@ -23,8 +23,8 @@ pub mod schema; use crate::sources::dnstap::parser::DnstapParser; use crate::sources::dnstap::schema::DNSTAP_VALUE_PATHS; use dnsmsg_parser::{dns_message, dns_message_parser}; -use lookup::lookup_v2::OptionalValuePath; pub use schema::DnstapEventSchema; +use vector_lib::lookup::lookup_v2::OptionalValuePath; use vector_lib::{ config::{LegacyKey, LogNamespace}, EstimatedJsonEncodedSizeOf, diff --git a/src/sources/dnstap/parser.rs b/src/sources/dnstap/parser.rs index ac2c1c0bf4b7b..29658d52e0ba0 100644 --- a/src/sources/dnstap/parser.rs +++ b/src/sources/dnstap/parser.rs @@ -33,9 +33,9 @@ use dnstap_proto::{ message::Type as DnstapMessageType, Dnstap, Message as DnstapMessage, SocketFamily, SocketProtocol, }; -use lookup::lookup_v2::ValuePath; -use lookup::PathPrefix; use vector_lib::config::log_schema; +use vector_lib::lookup::lookup_v2::ValuePath; +use vector_lib::lookup::PathPrefix; use super::{ dns_message::{ diff --git a/src/sources/dnstap/schema.rs b/src/sources/dnstap/schema.rs index 3d6919b08cee9..189b5a412babf 100644 --- a/src/sources/dnstap/schema.rs +++ b/src/sources/dnstap/schema.rs @@ -1,6 +1,6 @@ -use lookup::{owned_value_path, OwnedValuePath}; use once_cell::sync::Lazy; use std::collections::BTreeMap; +use vector_lib::lookup::{owned_value_path, OwnedValuePath}; use vrl::btreemap; use vrl::value::{ kind::{Collection, Field}, diff --git a/src/sources/docker_logs/mod.rs b/src/sources/docker_logs/mod.rs index 427b41c252e85..9e8ea6994ad5b 100644 --- a/src/sources/docker_logs/mod.rs +++ b/src/sources/docker_logs/mod.rs @@ -12,9 +12,6 @@ use bollard::{ use bytes::{Buf, Bytes}; use chrono::{DateTime, FixedOffset, Local, ParseError, Utc}; use futures::{Stream, StreamExt}; -use lookup::{ - lookup_v2::OptionalValuePath, metadata_path, owned_value_path, path, OwnedValuePath, PathPrefix, -}; use once_cell::sync::Lazy; use serde_with::serde_as; use tokio::sync::mpsc; @@ -25,6 +22,9 @@ use vector_lib::configurable::configurable_component; use vector_lib::internal_event::{ ByteSize, BytesReceived, InternalEventHandle as _, Protocol, Registered, }; +use vector_lib::lookup::{ + lookup_v2::OptionalValuePath, metadata_path, owned_value_path, path, OwnedValuePath, PathPrefix, +}; use vrl::event_path; use vrl::value::{kind::Collection, Kind}; diff --git a/src/sources/exec/mod.rs b/src/sources/exec/mod.rs index dd176424625e8..f7721e2cd2ba6 100644 --- a/src/sources/exec/mod.rs +++ b/src/sources/exec/mod.rs @@ -39,8 +39,8 @@ use crate::{ shutdown::ShutdownSignal, SourceSender, }; -use lookup::{owned_value_path, path}; use vector_lib::config::{log_schema, LogNamespace}; +use vector_lib::lookup::{owned_value_path, path}; #[cfg(test)] mod tests; diff --git a/src/sources/file.rs b/src/sources/file.rs index baeb6a3d956a7..ac7f7834b54fb 100644 --- a/src/sources/file.rs +++ b/src/sources/file.rs @@ -3,7 +3,6 @@ use std::{convert::TryInto, future, path::PathBuf, time::Duration}; use bytes::Bytes; use chrono::Utc; use futures::{FutureExt, Stream, StreamExt, TryFutureExt}; -use lookup::{lookup_v2::OptionalValuePath, owned_value_path, path, OwnedValuePath}; use regex::bytes::Regex; use serde_with::serde_as; use snafu::{ResultExt, Snafu}; @@ -18,6 +17,7 @@ use vector_lib::file_source::{ ReadFromConfig, }; use vector_lib::finalizer::OrderedFinalizer; +use vector_lib::lookup::{lookup_v2::OptionalValuePath, owned_value_path, path, OwnedValuePath}; use vector_lib::{ config::{LegacyKey, LogNamespace}, EstimatedJsonEncodedSizeOf, @@ -2268,7 +2268,7 @@ mod tests { Unfinalized, // Acknowledgement handling but no finalization Acks, // Full acknowledgements and proper finalization } - use lookup::OwnedTargetPath; + use vector_lib::lookup::OwnedTargetPath; use AckingMode::*; async fn run_file_source( diff --git a/src/sources/file_descriptors/file_descriptor.rs b/src/sources/file_descriptors/file_descriptor.rs index 0130b1847b278..f0b5f8ca2a250 100644 --- a/src/sources/file_descriptors/file_descriptor.rs +++ b/src/sources/file_descriptors/file_descriptor.rs @@ -2,10 +2,10 @@ use std::{fs::File, io, os::unix::io::FromRawFd}; use super::{outputs, FileDescriptorConfig}; use indoc::indoc; -use lookup::lookup_v2::OptionalValuePath; use vector_lib::codecs::decoding::{DeserializerConfig, FramingConfig}; use vector_lib::config::LogNamespace; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::lookup_v2::OptionalValuePath; use crate::{ config::{GenerateConfig, Resource, SourceConfig, SourceContext, SourceOutput}, @@ -101,8 +101,8 @@ impl SourceConfig for FileDescriptorSourceConfig { #[cfg(test)] mod tests { - use lookup::path; use nix::unistd::{close, pipe, write}; + use vector_lib::lookup::path; use super::*; use crate::{ diff --git a/src/sources/file_descriptors/mod.rs b/src/sources/file_descriptors/mod.rs index 19c7acfce961b..69b0987e2af94 100644 --- a/src/sources/file_descriptors/mod.rs +++ b/src/sources/file_descriptors/mod.rs @@ -4,7 +4,6 @@ use async_stream::stream; use bytes::Bytes; use chrono::Utc; use futures::{channel::mpsc, executor, SinkExt, StreamExt}; -use lookup::{lookup_v2::OptionalValuePath, owned_value_path, path, OwnedValuePath}; use tokio_util::{codec::FramedRead, io::StreamReader}; use vector_lib::codecs::{ decoding::{DeserializerConfig, FramingConfig}, @@ -14,6 +13,7 @@ use vector_lib::configurable::NamedComponent; use vector_lib::internal_event::{ ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Protocol, }; +use vector_lib::lookup::{lookup_v2::OptionalValuePath, owned_value_path, path, OwnedValuePath}; use vector_lib::{ config::{LegacyKey, LogNamespace}, event::Event, diff --git a/src/sources/file_descriptors/stdin.rs b/src/sources/file_descriptors/stdin.rs index f9679fc82f4b0..d659e6ebadc29 100644 --- a/src/sources/file_descriptors/stdin.rs +++ b/src/sources/file_descriptors/stdin.rs @@ -1,9 +1,9 @@ use std::io; -use lookup::lookup_v2::OptionalValuePath; use vector_lib::codecs::decoding::{DeserializerConfig, FramingConfig}; use vector_lib::config::LogNamespace; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::lookup_v2::OptionalValuePath; use crate::{ config::{Resource, SourceConfig, SourceContext, SourceOutput}, @@ -116,7 +116,7 @@ mod tests { SourceSender, }; use futures::StreamExt; - use lookup::path; + use vector_lib::lookup::path; use vrl::value; #[test] diff --git a/src/sources/fluent/mod.rs b/src/sources/fluent/mod.rs index 61f31e62b1f56..508579284147c 100644 --- a/src/sources/fluent/mod.rs +++ b/src/sources/fluent/mod.rs @@ -7,8 +7,6 @@ use base64::prelude::{Engine as _, BASE64_STANDARD}; use bytes::{Buf, Bytes, BytesMut}; use chrono::Utc; use flate2::read::MultiGzDecoder; -use lookup::lookup_v2::parse_value_path; -use lookup::{metadata_path, owned_value_path, path, OwnedValuePath}; use rmp_serde::{decode, Deserializer, Serializer}; use serde::{Deserialize, Serialize}; use smallvec::{smallvec, SmallVec}; @@ -16,6 +14,8 @@ use tokio_util::codec::Decoder; use vector_lib::codecs::{BytesDeserializerConfig, StreamDecodingError}; use vector_lib::config::{LegacyKey, LogNamespace}; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::lookup_v2::parse_value_path; +use vector_lib::lookup::{metadata_path, owned_value_path, path, OwnedValuePath}; use vector_lib::schema::Definition; use vrl::value::kind::Collection; use vrl::value::{Kind, Value}; @@ -629,7 +629,6 @@ impl From> for LogEvent { mod tests { use bytes::BytesMut; use chrono::{DateTime, Utc}; - use lookup::OwnedTargetPath; use rmp_serde::Serializer; use serde::Serialize; use std::collections::BTreeMap; @@ -639,6 +638,7 @@ mod tests { }; use tokio_util::codec::Decoder; use vector_lib::assert_event_data_eq; + use vector_lib::lookup::OwnedTargetPath; use vector_lib::{event::Value, schema::Definition}; use vrl::value::kind::Collection; diff --git a/src/sources/gcp_pubsub.rs b/src/sources/gcp_pubsub.rs index f30b0bb54488a..083de69108a4e 100644 --- a/src/sources/gcp_pubsub.rs +++ b/src/sources/gcp_pubsub.rs @@ -8,7 +8,6 @@ use chrono::NaiveDateTime; use derivative::Derivative; use futures::{stream, stream::FuturesUnordered, FutureExt, Stream, StreamExt, TryFutureExt}; use http::uri::{InvalidUri, Scheme, Uri}; -use lookup::owned_value_path; use once_cell::sync::Lazy; use serde_with::serde_as; use snafu::{ResultExt, Snafu}; @@ -25,6 +24,7 @@ use vector_lib::configurable::configurable_component; use vector_lib::internal_event::{ ByteSize, BytesReceived, EventsReceived, InternalEventHandle as _, Protocol, Registered, }; +use vector_lib::lookup::owned_value_path; use vector_lib::{byte_size_of::ByteSizeOf, finalizer::UnorderedFinalizer}; use vrl::path; use vrl::value::{kind::Collection, Kind}; @@ -744,7 +744,7 @@ impl Future for Task { #[cfg(test)] mod tests { - use lookup::OwnedTargetPath; + use vector_lib::lookup::OwnedTargetPath; use vector_lib::schema::Definition; use super::*; diff --git a/src/sources/heroku_logs.rs b/src/sources/heroku_logs.rs index eae4378dcd04b..3d3c7e84a6fde 100644 --- a/src/sources/heroku_logs.rs +++ b/src/sources/heroku_logs.rs @@ -7,13 +7,13 @@ use std::{ use bytes::{Buf, BufMut, Bytes, BytesMut}; use chrono::{DateTime, Utc}; -use lookup::{lookup_v2::parse_value_path, owned_value_path, path}; use smallvec::SmallVec; use tokio_util::codec::Decoder as _; use vector_lib::codecs::{ decoding::{DeserializerConfig, FramingConfig}, StreamDecodingError, }; +use vector_lib::lookup::{lookup_v2::parse_value_path, owned_value_path, path}; use vrl::value::{kind::Collection, Kind}; use warp::http::{HeaderMap, StatusCode}; @@ -408,8 +408,8 @@ mod tests { use chrono::{DateTime, Utc}; use futures::Stream; - use lookup::{owned_value_path, OwnedTargetPath}; use similar_asserts::assert_eq; + use vector_lib::lookup::{owned_value_path, OwnedTargetPath}; use vector_lib::{ config::LogNamespace, event::{Event, EventStatus, Value}, diff --git a/src/sources/http_server.rs b/src/sources/http_server.rs index d87f24030126d..366ad0fd5bad0 100644 --- a/src/sources/http_server.rs +++ b/src/sources/http_server.rs @@ -8,13 +8,13 @@ use tokio_util::codec::Decoder as _; use vrl::value::{kind::Collection, Kind}; use warp::http::{HeaderMap, HeaderValue}; -use lookup::{lookup_v2::OptionalValuePath, owned_value_path, path}; use vector_lib::codecs::{ decoding::{DeserializerConfig, FramingConfig}, BytesDecoderConfig, BytesDeserializerConfig, JsonDeserializerConfig, NewlineDelimitedDecoderConfig, }; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::{lookup_v2::OptionalValuePath, owned_value_path, path}; use vector_lib::{ config::{DataType, LegacyKey, LogNamespace}, schema::Definition, @@ -489,14 +489,14 @@ mod tests { use vrl::value::kind::Collection; use vrl::value::Kind; - use lookup::lookup_v2::OptionalValuePath; - use lookup::{event_path, owned_value_path, OwnedTargetPath}; use vector_lib::codecs::{ decoding::{DeserializerConfig, FramingConfig}, BytesDecoderConfig, JsonDeserializerConfig, }; use vector_lib::config::LogNamespace; use vector_lib::event::LogEvent; + use vector_lib::lookup::lookup_v2::OptionalValuePath; + use vector_lib::lookup::{event_path, owned_value_path, OwnedTargetPath, PathPrefix}; use vector_lib::schema::Definition; use crate::sources::http_server::HttpMethod; @@ -963,10 +963,7 @@ mod tests { assert!(log.get_timestamp().is_some()); let source_type_key_value = log - .get(( - lookup::PathPrefix::Event, - log_schema().source_type_key().unwrap(), - )) + .get((PathPrefix::Event, log_schema().source_type_key().unwrap())) .unwrap() .as_str() .unwrap(); diff --git a/src/sources/internal_logs.rs b/src/sources/internal_logs.rs index 8d694decce906..c1205710fd4f4 100644 --- a/src/sources/internal_logs.rs +++ b/src/sources/internal_logs.rs @@ -1,10 +1,10 @@ use chrono::Utc; use futures::{stream, StreamExt}; -use lookup::lookup_v2::OptionalValuePath; -use lookup::{owned_value_path, path, OwnedValuePath}; use vector_lib::codecs::BytesDeserializerConfig; use vector_lib::config::log_schema; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::lookup_v2::OptionalValuePath; +use vector_lib::lookup::{owned_value_path, path, OwnedValuePath}; use vector_lib::{ config::{LegacyKey, LogNamespace}, schema::Definition, @@ -204,9 +204,9 @@ async fn run( #[cfg(test)] mod tests { use futures::Stream; - use lookup::OwnedTargetPath; use tokio::time::{sleep, Duration}; use vector_lib::event::Value; + use vector_lib::lookup::OwnedTargetPath; use vrl::value::kind::Collection; use super::*; diff --git a/src/sources/internal_metrics.rs b/src/sources/internal_metrics.rs index be1c93fc2a99c..4c5ebcee9a5ad 100644 --- a/src/sources/internal_metrics.rs +++ b/src/sources/internal_metrics.rs @@ -1,12 +1,12 @@ use std::time::Duration; use futures::StreamExt; -use lookup::lookup_v2::OptionalValuePath; use serde_with::serde_as; use tokio::time; use tokio_stream::wrappers::IntervalStream; use vector_lib::configurable::configurable_component; use vector_lib::internal_event::{CountByteSize, InternalEventHandle as _}; +use vector_lib::lookup::lookup_v2::OptionalValuePath; use vector_lib::{config::LogNamespace, ByteSizeOf, EstimatedJsonEncodedSizeOf}; use crate::{ diff --git a/src/sources/journald.rs b/src/sources/journald.rs index 94169b01d76d8..a8f926907746c 100644 --- a/src/sources/journald.rs +++ b/src/sources/journald.rs @@ -11,7 +11,6 @@ use std::{ use bytes::Bytes; use chrono::{TimeZone, Utc}; use futures::{poll, stream::BoxStream, task::Poll, StreamExt}; -use lookup::{metadata_path, owned_value_path, path}; use nix::{ sys::signal::{kill, Signal}, unistd::Pid, @@ -29,6 +28,7 @@ use tokio::{ use tokio_util::codec::FramedRead; use vector_lib::codecs::{decoding::BoxedFramingError, CharacterDelimitedDecoder}; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::{metadata_path, owned_value_path, path}; use vector_lib::{ config::{LegacyKey, LogNamespace}, schema::Definition, diff --git a/src/sources/kafka.rs b/src/sources/kafka.rs index a26b982c85b1b..89da9b039c14d 100644 --- a/src/sources/kafka.rs +++ b/src/sources/kafka.rs @@ -14,7 +14,6 @@ use bytes::Bytes; use chrono::{DateTime, TimeZone, Utc}; use futures::{Stream, StreamExt}; use futures_util::future::OptionFuture; -use lookup::{lookup_v2::OptionalValuePath, owned_value_path, path, OwnedValuePath}; use rdkafka::{ consumer::{ stream_consumer::StreamPartitionQueue, CommitMode, Consumer, ConsumerContext, Rebalance, @@ -41,6 +40,7 @@ use vector_lib::codecs::{ decoding::{DeserializerConfig, FramingConfig}, StreamDecodingError, }; +use vector_lib::lookup::{lookup_v2::OptionalValuePath, owned_value_path, path, OwnedValuePath}; use vector_lib::configurable::configurable_component; use vector_lib::finalizer::OrderedFinalizer; @@ -1363,7 +1363,7 @@ impl ConsumerContext for KafkaSourceContext { #[cfg(test)] mod test { - use lookup::OwnedTargetPath; + use vector_lib::lookup::OwnedTargetPath; use vector_lib::schema::Definition; use super::*; diff --git a/src/sources/kubernetes_logs/mod.rs b/src/sources/kubernetes_logs/mod.rs index c2b245d3436e2..4da8abd8ed8cb 100644 --- a/src/sources/kubernetes_logs/mod.rs +++ b/src/sources/kubernetes_logs/mod.rs @@ -19,7 +19,6 @@ use kube::{ Client, Config as ClientConfig, }; use lifecycle::Lifecycle; -use lookup::{lookup_v2::OptionalTargetPath, owned_value_path, path, OwnedTargetPath}; use serde_with::serde_as; use vector_lib::codecs::{BytesDeserializer, BytesDeserializerConfig}; use vector_lib::configurable::configurable_component; @@ -27,6 +26,7 @@ use vector_lib::file_source::{ calculate_ignore_before, Checkpointer, FileServer, FileServerShutdown, FingerprintStrategy, Fingerprinter, Line, ReadFrom, ReadFromConfig, }; +use vector_lib::lookup::{lookup_v2::OptionalTargetPath, owned_value_path, path, OwnedTargetPath}; use vector_lib::{config::LegacyKey, config::LogNamespace, EstimatedJsonEncodedSizeOf}; use vector_lib::{ internal_event::{ByteSize, BytesReceived, InternalEventHandle as _, Protocol}, @@ -1045,8 +1045,8 @@ fn prepare_label_selector(selector: &str) -> String { #[cfg(test)] mod tests { - use lookup::{owned_value_path, OwnedTargetPath}; use similar_asserts::assert_eq; + use vector_lib::lookup::{owned_value_path, OwnedTargetPath}; use vector_lib::{config::LogNamespace, schema::Definition}; use vrl::value::{kind::Collection, Kind}; diff --git a/src/sources/kubernetes_logs/namespace_metadata_annotator.rs b/src/sources/kubernetes_logs/namespace_metadata_annotator.rs index 1ea034033183b..d97639ad46cbf 100644 --- a/src/sources/kubernetes_logs/namespace_metadata_annotator.rs +++ b/src/sources/kubernetes_logs/namespace_metadata_annotator.rs @@ -4,10 +4,10 @@ use k8s_openapi::{api::core::v1::Namespace, apimachinery::pkg::apis::meta::v1::ObjectMeta}; use kube::runtime::reflector::{store::Store, ObjectRef}; -use lookup::lookup_v2::OptionalTargetPath; -use lookup::{lookup_v2::ValuePath, owned_value_path, path, OwnedTargetPath}; use vector_lib::config::{LegacyKey, LogNamespace}; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::lookup_v2::OptionalTargetPath; +use vector_lib::lookup::{lookup_v2::ValuePath, owned_value_path, path, OwnedTargetPath}; use crate::event::{Event, LogEvent}; @@ -104,8 +104,8 @@ fn annotate_from_metadata( #[cfg(test)] mod tests { - use lookup::{event_path, metadata_path}; use similar_asserts::assert_eq; + use vector_lib::lookup::{event_path, metadata_path}; use super::*; diff --git a/src/sources/kubernetes_logs/node_metadata_annotator.rs b/src/sources/kubernetes_logs/node_metadata_annotator.rs index 25260cb321620..5342e7ae8caac 100644 --- a/src/sources/kubernetes_logs/node_metadata_annotator.rs +++ b/src/sources/kubernetes_logs/node_metadata_annotator.rs @@ -5,10 +5,10 @@ use crate::event::{Event, LogEvent}; use k8s_openapi::{api::core::v1::Node, apimachinery::pkg::apis::meta::v1::ObjectMeta}; use kube::runtime::reflector::{store::Store, ObjectRef}; -use lookup::lookup_v2::OptionalTargetPath; -use lookup::{lookup_v2::ValuePath, owned_value_path, path, OwnedTargetPath}; use vector_lib::config::{LegacyKey, LogNamespace}; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::lookup_v2::OptionalTargetPath; +use vector_lib::lookup::{lookup_v2::ValuePath, owned_value_path, path, OwnedTargetPath}; use super::Config; @@ -95,8 +95,8 @@ fn annotate_from_metadata( #[cfg(test)] mod tests { - use lookup::{event_path, lookup_v2::parse_target_path, metadata_path}; use similar_asserts::assert_eq; + use vector_lib::lookup::{event_path, lookup_v2::parse_target_path, metadata_path}; use super::*; diff --git a/src/sources/kubernetes_logs/parser/cri.rs b/src/sources/kubernetes_logs/parser/cri.rs index ee1d5f18a65ab..f5c5f16d5561e 100644 --- a/src/sources/kubernetes_logs/parser/cri.rs +++ b/src/sources/kubernetes_logs/parser/cri.rs @@ -1,8 +1,8 @@ use chrono::{DateTime, Utc}; use derivative::Derivative; -use lookup::path; use vector_lib::config::{log_schema, LegacyKey, LogNamespace}; use vector_lib::conversion; +use vector_lib::lookup::path; use crate::sources::kubernetes_logs::transform_utils::get_message_path; use crate::{ diff --git a/src/sources/kubernetes_logs/parser/docker.rs b/src/sources/kubernetes_logs/parser/docker.rs index ee19343f44993..f51d25385bf56 100644 --- a/src/sources/kubernetes_logs/parser/docker.rs +++ b/src/sources/kubernetes_logs/parser/docker.rs @@ -1,9 +1,9 @@ use bytes::Bytes; use chrono::{DateTime, Utc}; -use lookup::{path, OwnedTargetPath}; use serde_json::Value as JsonValue; use snafu::{OptionExt, ResultExt, Snafu}; use vector_lib::config::{LegacyKey, LogNamespace}; +use vector_lib::lookup::{self, path, OwnedTargetPath}; use crate::sources::kubernetes_logs::transform_utils::get_message_path; use crate::{ diff --git a/src/sources/kubernetes_logs/parser/mod.rs b/src/sources/kubernetes_logs/parser/mod.rs index 263f26c069ead..cfaf1488a20a4 100644 --- a/src/sources/kubernetes_logs/parser/mod.rs +++ b/src/sources/kubernetes_logs/parser/mod.rs @@ -79,7 +79,7 @@ impl FunctionTransform for Parser { #[cfg(test)] mod tests { use bytes::Bytes; - use lookup::event_path; + use vector_lib::lookup::event_path; use vrl::value; use super::*; diff --git a/src/sources/kubernetes_logs/parser/test_util.rs b/src/sources/kubernetes_logs/parser/test_util.rs index 25657fe7a1cc6..dd3fe44eaa2d5 100644 --- a/src/sources/kubernetes_logs/parser/test_util.rs +++ b/src/sources/kubernetes_logs/parser/test_util.rs @@ -2,7 +2,7 @@ use similar_asserts::assert_eq; use chrono::{DateTime, Utc}; -use lookup::{event_path, metadata_path}; +use vector_lib::lookup::{event_path, metadata_path}; use vector_lib::{config::LogNamespace, event}; use vrl::value; use vrl::value::Value; diff --git a/src/sources/kubernetes_logs/partial_events_merger.rs b/src/sources/kubernetes_logs/partial_events_merger.rs index 4a0ac987f8eb8..fe425b4972003 100644 --- a/src/sources/kubernetes_logs/partial_events_merger.rs +++ b/src/sources/kubernetes_logs/partial_events_merger.rs @@ -2,10 +2,10 @@ use bytes::BytesMut; use futures::{Stream, StreamExt}; -use lookup::OwnedTargetPath; use std::collections::HashMap; use std::time::{Duration, Instant}; use vector_lib::config::LogNamespace; +use vector_lib::lookup::OwnedTargetPath; use vector_lib::stream::expiration_map::{map_with_expiration, Emitter}; use vrl::owned_value_path; diff --git a/src/sources/kubernetes_logs/pod_metadata_annotator.rs b/src/sources/kubernetes_logs/pod_metadata_annotator.rs index 933e5887489b2..1cb8ca5728b40 100644 --- a/src/sources/kubernetes_logs/pod_metadata_annotator.rs +++ b/src/sources/kubernetes_logs/pod_metadata_annotator.rs @@ -7,12 +7,12 @@ use k8s_openapi::{ apimachinery::pkg::apis::meta::v1::ObjectMeta, }; use kube::runtime::reflector::{store::Store, ObjectRef}; -use lookup::{ +use vector_lib::config::{LegacyKey, LogNamespace}; +use vector_lib::configurable::configurable_component; +use vector_lib::lookup::{ lookup_v2::{OptionalTargetPath, ValuePath}, owned_value_path, path, OwnedTargetPath, }; -use vector_lib::config::{LegacyKey, LogNamespace}; -use vector_lib::configurable::configurable_component; use super::{ path_helpers::{parse_log_file_path, LogFileInfo}, @@ -479,8 +479,8 @@ fn annotate_from_container( #[cfg(test)] mod tests { use k8s_openapi::api::core::v1::PodIP; - use lookup::{event_path, metadata_path}; use similar_asserts::assert_eq; + use vector_lib::lookup::{event_path, metadata_path}; use super::*; diff --git a/src/sources/logstash.rs b/src/sources/logstash.rs index 46f46fe508092..c130162b2c5cd 100644 --- a/src/sources/logstash.rs +++ b/src/sources/logstash.rs @@ -8,12 +8,12 @@ use std::{ use bytes::{Buf, Bytes, BytesMut}; use flate2::read::ZlibDecoder; -use lookup::{event_path, metadata_path, owned_value_path, path, OwnedValuePath}; use smallvec::{smallvec, SmallVec}; use snafu::{ResultExt, Snafu}; use tokio_util::codec::Decoder; use vector_lib::codecs::{BytesDeserializerConfig, StreamDecodingError}; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::{event_path, metadata_path, owned_value_path, path, OwnedValuePath}; use vector_lib::{ config::{LegacyKey, LogNamespace}, schema::Definition, @@ -679,9 +679,9 @@ impl From for SmallVec<[Event; 1]> { #[cfg(test)] mod test { use bytes::BufMut; - use lookup::OwnedTargetPath; use rand::{thread_rng, Rng}; use tokio::io::{AsyncReadExt, AsyncWriteExt}; + use vector_lib::lookup::OwnedTargetPath; use vrl::value::kind::Collection; use super::*; diff --git a/src/sources/nats.rs b/src/sources/nats.rs index 3aec2874a1100..7b67b86ec1d18 100644 --- a/src/sources/nats.rs +++ b/src/sources/nats.rs @@ -1,6 +1,5 @@ use chrono::Utc; use futures::{pin_mut, StreamExt}; -use lookup::{lookup_v2::OptionalValuePath, owned_value_path}; use snafu::{ResultExt, Snafu}; use tokio_util::codec::FramedRead; use vector_lib::codecs::decoding::{DeserializerConfig, FramingConfig, StreamDecodingError}; @@ -8,6 +7,7 @@ use vector_lib::configurable::configurable_component; use vector_lib::internal_event::{ ByteSize, BytesReceived, CountByteSize, EventsReceived, InternalEventHandle as _, Protocol, }; +use vector_lib::lookup::{lookup_v2::OptionalValuePath, owned_value_path}; use vector_lib::{ config::{LegacyKey, LogNamespace}, EstimatedJsonEncodedSizeOf, @@ -287,7 +287,7 @@ async fn create_subscription( mod tests { #![allow(clippy::print_stdout)] //tests - use lookup::{owned_value_path, OwnedTargetPath}; + use vector_lib::lookup::{owned_value_path, OwnedTargetPath}; use vector_lib::schema::Definition; use vrl::value::{kind::Collection, Kind}; diff --git a/src/sources/opentelemetry/mod.rs b/src/sources/opentelemetry/mod.rs index 9ed04c4294b35..dff96ed6ac17c 100644 --- a/src/sources/opentelemetry/mod.rs +++ b/src/sources/opentelemetry/mod.rs @@ -11,7 +11,7 @@ mod status; use std::net::SocketAddr; use futures::{future::join, FutureExt, TryFutureExt}; -use lookup::{owned_value_path, OwnedTargetPath}; +use vector_lib::lookup::{owned_value_path, OwnedTargetPath}; use vector_lib::opentelemetry::convert::{ ATTRIBUTES_KEY, DROPPED_ATTRIBUTES_COUNT_KEY, FLAGS_KEY, OBSERVED_TIMESTAMP_KEY, RESOURCE_KEY, SEVERITY_NUMBER_KEY, SEVERITY_TEXT_KEY, SPAN_ID_KEY, TRACE_ID_KEY, diff --git a/src/sources/opentelemetry/tests.rs b/src/sources/opentelemetry/tests.rs index ca88202bf13e9..4d381d84582e7 100644 --- a/src/sources/opentelemetry/tests.rs +++ b/src/sources/opentelemetry/tests.rs @@ -1,12 +1,12 @@ use chrono::{TimeZone, Utc}; use futures::Stream; use futures_util::StreamExt; -use lookup::path; use similar_asserts::assert_eq; use std::collections::BTreeMap; use std::sync::Arc; use tonic::Request; use vector_lib::config::LogNamespace; +use vector_lib::lookup::path; use vector_lib::opentelemetry::proto::{ collector::logs::v1::{logs_service_client::LogsServiceClient, ExportLogsServiceRequest}, common::v1::{any_value, AnyValue, KeyValue}, diff --git a/src/sources/redis/mod.rs b/src/sources/redis/mod.rs index 1b3375066364a..3f8086f8f1d42 100644 --- a/src/sources/redis/mod.rs +++ b/src/sources/redis/mod.rs @@ -1,7 +1,6 @@ use bytes::Bytes; use chrono::Utc; use futures::StreamExt; -use lookup::{lookup_v2::OptionalValuePath, owned_value_path, path, OwnedValuePath}; use snafu::{ResultExt, Snafu}; use tokio_util::codec::FramedRead; use vector_lib::codecs::{ @@ -12,6 +11,7 @@ use vector_lib::configurable::configurable_component; use vector_lib::internal_event::{ ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Protocol, Registered, }; +use vector_lib::lookup::{lookup_v2::OptionalValuePath, owned_value_path, path, OwnedValuePath}; use vector_lib::{ config::{LegacyKey, LogNamespace}, EstimatedJsonEncodedSizeOf, diff --git a/src/sources/socket/mod.rs b/src/sources/socket/mod.rs index 62f044714e2c8..6bc219e636d1f 100644 --- a/src/sources/socket/mod.rs +++ b/src/sources/socket/mod.rs @@ -3,10 +3,10 @@ pub mod udp; #[cfg(unix)] mod unix; -use lookup::{lookup_v2::OptionalValuePath, owned_value_path}; use vector_lib::codecs::decoding::DeserializerConfig; use vector_lib::config::{log_schema, LegacyKey, LogNamespace}; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::{lookup_v2::OptionalValuePath, owned_value_path}; use vrl::value::{kind::Collection, Kind}; #[cfg(unix)] @@ -333,7 +333,6 @@ mod test { use bytes::{BufMut, Bytes, BytesMut}; use futures::{stream, StreamExt}; - use lookup::{lookup_v2::OptionalValuePath, owned_value_path, path}; use tokio::io::AsyncReadExt; use tokio::net::TcpStream; use tokio::{ @@ -346,6 +345,7 @@ mod test { decoding::CharacterDelimitedDecoderOptions, CharacterDelimitedDecoderConfig, }; use vector_lib::event::EventContainer; + use vector_lib::lookup::{lookup_v2::OptionalValuePath, owned_value_path, path}; use vrl::btreemap; use vrl::value; use vrl::value::Value; diff --git a/src/sources/socket/tcp.rs b/src/sources/socket/tcp.rs index 955eceb80fc55..fe05930342872 100644 --- a/src/sources/socket/tcp.rs +++ b/src/sources/socket/tcp.rs @@ -1,12 +1,12 @@ use std::time::Duration; use chrono::Utc; -use lookup::{lookup_v2::OptionalValuePath, owned_value_path, path}; use serde_with::serde_as; use smallvec::SmallVec; use vector_lib::codecs::decoding::{DeserializerConfig, FramingConfig}; use vector_lib::config::{LegacyKey, LogNamespace}; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::{lookup_v2::OptionalValuePath, owned_value_path, path}; use crate::{ codecs::Decoder, diff --git a/src/sources/socket/udp.rs b/src/sources/socket/udp.rs index b2c557c608a59..8b80fff217211 100644 --- a/src/sources/socket/udp.rs +++ b/src/sources/socket/udp.rs @@ -2,7 +2,6 @@ use bytes::BytesMut; use chrono::Utc; use futures::StreamExt; use listenfd::ListenFd; -use lookup::{lookup_v2::OptionalValuePath, owned_value_path, path}; use tokio_util::codec::FramedRead; use vector_lib::codecs::{ decoding::{DeserializerConfig, FramingConfig}, @@ -10,6 +9,7 @@ use vector_lib::codecs::{ }; use vector_lib::configurable::configurable_component; use vector_lib::internal_event::{ByteSize, BytesReceived, InternalEventHandle as _, Protocol}; +use vector_lib::lookup::{lookup_v2::OptionalValuePath, owned_value_path, path}; use vector_lib::{ config::{LegacyKey, LogNamespace}, EstimatedJsonEncodedSizeOf, diff --git a/src/sources/socket/unix.rs b/src/sources/socket/unix.rs index 8624340db7748..d61705c1a37fd 100644 --- a/src/sources/socket/unix.rs +++ b/src/sources/socket/unix.rs @@ -2,10 +2,10 @@ use std::path::PathBuf; use bytes::Bytes; use chrono::Utc; -use lookup::{lookup_v2::OptionalValuePath, path}; use vector_lib::codecs::decoding::{DeserializerConfig, FramingConfig}; use vector_lib::config::{LegacyKey, LogNamespace}; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::{lookup_v2::OptionalValuePath, path}; use vector_lib::shutdown::ShutdownSignal; use crate::{ diff --git a/src/sources/splunk_hec/mod.rs b/src/sources/splunk_hec/mod.rs index a11bf1a1374df..745e419c888ea 100644 --- a/src/sources/splunk_hec/mod.rs +++ b/src/sources/splunk_hec/mod.rs @@ -12,8 +12,6 @@ use flate2::read::MultiGzDecoder; use futures::FutureExt; use http::StatusCode; use hyper::{service::make_service_fn, Server}; -use lookup::lookup_v2::OptionalValuePath; -use lookup::{event_path, owned_value_path}; use serde::Serialize; use serde_json::{de::Read as JsonRead, Deserializer, Value as JsonValue}; use snafu::Snafu; @@ -21,6 +19,8 @@ use tower::ServiceBuilder; use tracing::Span; use vector_lib::configurable::configurable_component; use vector_lib::internal_event::{CountByteSize, InternalEventHandle as _, Registered}; +use vector_lib::lookup::lookup_v2::OptionalValuePath; +use vector_lib::lookup::{self, event_path, owned_value_path}; use vector_lib::sensitive_string::SensitiveString; use vector_lib::{ config::{LegacyKey, LogNamespace}, diff --git a/src/sources/syslog.rs b/src/sources/syslog.rs index 1b051de08c80b..ff33e176c4502 100644 --- a/src/sources/syslog.rs +++ b/src/sources/syslog.rs @@ -6,7 +6,6 @@ use bytes::Bytes; use chrono::Utc; use futures::StreamExt; use listenfd::ListenFd; -use lookup::{lookup_v2::OptionalValuePath, path, OwnedValuePath}; use smallvec::SmallVec; use tokio_util::udp::UdpFramed; use vector_lib::codecs::{ @@ -15,6 +14,7 @@ use vector_lib::codecs::{ }; use vector_lib::config::{LegacyKey, LogNamespace}; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::{lookup_v2::OptionalValuePath, path, OwnedValuePath}; use vrl::event_path; #[cfg(unix)] @@ -435,12 +435,12 @@ fn enrich_syslog_event( #[cfg(test)] mod test { - use lookup::{event_path, owned_value_path, OwnedTargetPath}; use std::{ collections::{BTreeMap, HashMap}, fmt, str::FromStr, }; + use vector_lib::lookup::{event_path, owned_value_path, OwnedTargetPath}; use chrono::prelude::*; use rand::{thread_rng, Rng}; @@ -449,6 +449,7 @@ mod test { use tokio_util::codec::BytesCodec; use vector_lib::assert_event_data_eq; use vector_lib::codecs::decoding::format::Deserializer; + use vector_lib::lookup::PathPrefix; use vector_lib::{config::ComponentKey, schema::Definition}; use vrl::value::{kind::Collection, Kind, Value}; @@ -800,10 +801,7 @@ mod test { { let expected = expected.as_mut_log(); expected.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), Utc.with_ymd_and_hms(2019, 2, 13, 19, 48, 34) .single() .expect("invalid timestamp"), @@ -853,10 +851,7 @@ mod test { { let expected = expected.as_mut_log(); expected.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), Utc.with_ymd_and_hms(2019, 2, 13, 19, 48, 34) .single() .expect("invalid timestamp"), @@ -1002,10 +997,7 @@ mod test { .into(); expected.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), expected_date, ); expected.insert( @@ -1054,10 +1046,7 @@ mod test { .expect("invalid timestamp") .into(); expected.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), expected_date, ); expected.insert( @@ -1091,10 +1080,7 @@ mod test { { let expected = expected.as_mut_log(); expected.insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), Utc.with_ymd_and_hms(2019, 2, 13, 21, 53, 30) .single() .and_then(|t| t.with_nanosecond(605_850 * 1000)) diff --git a/src/sources/util/framestream.rs b/src/sources/util/framestream.rs index 0583c0413cf4b..8571f2d1a4458 100644 --- a/src/sources/util/framestream.rs +++ b/src/sources/util/framestream.rs @@ -20,11 +20,11 @@ use futures::{ sink::{Sink, SinkExt}, stream::{self, StreamExt, TryStreamExt}, }; -use lookup::OwnedValuePath; use tokio::{self, net::UnixListener, task::JoinHandle}; use tokio_stream::wrappers::UnixListenerStream; use tokio_util::codec::{length_delimited, Framed}; use tracing::{field, Instrument}; +use vector_lib::lookup::OwnedValuePath; use crate::{ event::Event, @@ -595,7 +595,6 @@ mod test { sink::{Sink, SinkExt}, stream::{self, StreamExt}, }; - use lookup::{owned_value_path, path, OwnedValuePath}; use tokio::{ self, net::UnixStream, @@ -604,6 +603,7 @@ mod test { }; use tokio_util::codec::{length_delimited, Framed}; use vector_lib::config::{LegacyKey, LogNamespace}; + use vector_lib::lookup::{owned_value_path, path, OwnedValuePath}; use super::{ build_framestream_unix_source, spawn_event_handling_tasks, ControlField, ControlHeader, diff --git a/src/sources/util/http/query.rs b/src/sources/util/http/query.rs index 53dbf4fbf51c8..fb89694530de1 100644 --- a/src/sources/util/http/query.rs +++ b/src/sources/util/http/query.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use lookup::path; +use vector_lib::lookup::path; use vector_lib::{ config::{LegacyKey, LogNamespace}, event::Event, diff --git a/src/sources/util/message_decoding.rs b/src/sources/util/message_decoding.rs index 7fcb43ea77163..9a587cd1b3af0 100644 --- a/src/sources/util/message_decoding.rs +++ b/src/sources/util/message_decoding.rs @@ -2,12 +2,12 @@ use std::iter; use bytes::{Bytes, BytesMut}; use chrono::{DateTime, Utc}; -use lookup::{metadata_path, path, PathPrefix}; use tokio_util::codec::Decoder as _; use vector_lib::codecs::StreamDecodingError; use vector_lib::internal_event::{ CountByteSize, EventsReceived, InternalEventHandle as _, Registered, }; +use vector_lib::lookup::{metadata_path, path, PathPrefix}; use vector_lib::{config::LogNamespace, EstimatedJsonEncodedSizeOf}; use crate::{codecs::Decoder, config::log_schema, event::BatchNotifier, event::Event}; diff --git a/src/sources/util/net/tcp/mod.rs b/src/sources/util/net/tcp/mod.rs index a25ff055e1309..f68e6302c4ee2 100644 --- a/src/sources/util/net/tcp/mod.rs +++ b/src/sources/util/net/tcp/mod.rs @@ -6,7 +6,6 @@ use bytes::Bytes; use futures::{future::BoxFuture, FutureExt, StreamExt}; use futures_util::future::OptionFuture; use listenfd::ListenFd; -use lookup::{path, OwnedValuePath}; use smallvec::SmallVec; use socket2::SockRef; use tokio::{ @@ -18,6 +17,7 @@ use tokio_util::codec::{Decoder, FramedRead}; use tracing::Instrument; use vector_lib::codecs::StreamDecodingError; use vector_lib::finalization::AddBatchNotifier; +use vector_lib::lookup::{path, OwnedValuePath}; use vector_lib::{ config::{LegacyKey, LogNamespace, SourceAcknowledgementsConfig}, EstimatedJsonEncodedSizeOf, diff --git a/src/sources/vector/mod.rs b/src/sources/vector/mod.rs index 0df5d61f70829..edaa3ceddf3f4 100644 --- a/src/sources/vector/mod.rs +++ b/src/sources/vector/mod.rs @@ -214,7 +214,7 @@ impl SourceConfig for VectorConfig { #[cfg(test)] mod test { - use lookup::owned_value_path; + use vector_lib::lookup::owned_value_path; use vector_lib::{config::LogNamespace, schema::Definition}; use vrl::value::{kind::Collection, Kind}; diff --git a/src/template.rs b/src/template.rs index 510679ff70ee7..3eccf14712684 100644 --- a/src/template.rs +++ b/src/template.rs @@ -6,11 +6,11 @@ use chrono::{ format::{strftime::StrftimeItems, Item}, Utc, }; -use lookup::lookup_v2::parse_target_path; use once_cell::sync::Lazy; use regex::Regex; use snafu::Snafu; use vector_lib::configurable::{configurable_component, ConfigurableString}; +use vector_lib::lookup::lookup_v2::parse_target_path; use crate::{ config::log_schema, @@ -373,7 +373,7 @@ fn render_timestamp(items: &ParsedStrftime, event: EventRef<'_>) -> String { #[cfg(test)] mod tests { use chrono::TimeZone; - use lookup::metadata_path; + use vector_lib::lookup::{metadata_path, PathPrefix}; use vector_lib::metric_tags; use super::*; @@ -542,10 +542,7 @@ mod tests { let mut event = Event::Log(LogEvent::from("hello world")); event.as_mut_log().insert("foo", "butts"); event.as_mut_log().insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), ts, ); @@ -567,10 +564,7 @@ mod tests { let mut event = Event::Log(LogEvent::from("hello world")); event.as_mut_log().insert("format", "%F"); event.as_mut_log().insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), ts, ); @@ -592,10 +586,7 @@ mod tests { let mut event = Event::Log(LogEvent::from("hello world")); event.as_mut_log().insert("\"%F\"", "foo"); event.as_mut_log().insert( - ( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - ), + (PathPrefix::Event, log_schema().timestamp_key().unwrap()), ts, ); diff --git a/src/topology/schema.rs b/src/topology/schema.rs index ca7fc00040a59..63e46f9d95f56 100644 --- a/src/topology/schema.rs +++ b/src/topology/schema.rs @@ -442,9 +442,9 @@ mod tests { use std::collections::HashMap; use indexmap::IndexMap; - use lookup::owned_value_path; use similar_asserts::assert_eq; use vector_lib::config::{DataType, SourceOutput, TransformOutput}; + use vector_lib::lookup::owned_value_path; use vrl::value::Kind; use super::*; diff --git a/src/trace.rs b/src/trace.rs index defb3997331e8..5f2b2c332c1e1 100644 --- a/src/trace.rs +++ b/src/trace.rs @@ -10,7 +10,6 @@ use std::{ }; use futures_util::{future::ready, Stream, StreamExt}; -use lookup::event_path; use metrics_tracing_context::MetricsLayer; use tokio::sync::{ broadcast::{self, Receiver, Sender}, @@ -27,6 +26,7 @@ use tracing_subscriber::{ Layer, }; pub use tracing_tower::{InstrumentableService, InstrumentedService}; +use vector_lib::lookup::event_path; use vrl::value::Value; use crate::event::LogEvent; diff --git a/src/transforms/aws_ec2_metadata.rs b/src/transforms/aws_ec2_metadata.rs index 4ff5d3a3b604c..cb81b28e35d28 100644 --- a/src/transforms/aws_ec2_metadata.rs +++ b/src/transforms/aws_ec2_metadata.rs @@ -5,9 +5,6 @@ use bytes::Bytes; use futures::{Stream, StreamExt}; use http::{uri::PathAndQuery, Request, StatusCode, Uri}; use hyper::{body::to_bytes as body_to_bytes, Body}; -use lookup::lookup_v2::{OptionalTargetPath, OwnedSegment}; -use lookup::owned_value_path; -use lookup::OwnedTargetPath; use once_cell::sync::Lazy; use serde::Deserialize; use serde_with::serde_as; @@ -16,6 +13,9 @@ use tokio::time::{sleep, Duration, Instant}; use tracing::Instrument; use vector_lib::config::LogNamespace; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::lookup_v2::{OptionalTargetPath, OwnedSegment}; +use vector_lib::lookup::owned_value_path; +use vector_lib::lookup::OwnedTargetPath; use vrl::value::kind::Collection; use vrl::value::Kind; @@ -719,8 +719,8 @@ mod test { use crate::config::schema::Definition; use crate::config::{LogNamespace, OutputId, TransformConfig}; use crate::transforms::aws_ec2_metadata::Ec2Metadata; - use lookup::OwnedTargetPath; use vector_lib::enrichment::TableRegistry; + use vector_lib::lookup::OwnedTargetPath; use vrl::owned_value_path; use vrl::value::Kind; @@ -749,10 +749,10 @@ mod test { #[cfg(feature = "aws-ec2-metadata-integration-tests")] #[cfg(test)] mod integration_tests { - use lookup::lookup_v2::{OwnedSegment, OwnedValuePath}; - use lookup::{event_path, PathPrefix}; use tokio::sync::mpsc; use tokio_stream::wrappers::ReceiverStream; + use vector_lib::lookup::lookup_v2::{OwnedSegment, OwnedValuePath}; + use vector_lib::lookup::{event_path, PathPrefix}; use super::*; use crate::{ diff --git a/src/transforms/dedupe.rs b/src/transforms/dedupe.rs index 1d09059b4efbd..5ac6918885dc9 100644 --- a/src/transforms/dedupe.rs +++ b/src/transforms/dedupe.rs @@ -2,10 +2,10 @@ use std::{future::ready, num::NonZeroUsize, pin::Pin}; use bytes::Bytes; use futures::{Stream, StreamExt}; -use lookup::lookup_v2::ConfigTargetPath; use lru::LruCache; use vector_lib::config::{clone_input_definitions, LogNamespace}; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::lookup_v2::ConfigTargetPath; use vrl::path::OwnedTargetPath; use crate::{ @@ -295,11 +295,11 @@ impl TaskTransform for Dedupe { mod tests { use std::{collections::BTreeMap, sync::Arc}; - use lookup::lookup_v2::ConfigTargetPath; use tokio::sync::mpsc; use tokio_stream::wrappers::ReceiverStream; use vector_lib::config::ComponentKey; use vector_lib::config::OutputId; + use vector_lib::lookup::lookup_v2::ConfigTargetPath; use crate::config::schema::Definition; use crate::{ diff --git a/src/transforms/metric_to_log.rs b/src/transforms/metric_to_log.rs index 130a5384155c0..8b556b784f2b6 100644 --- a/src/transforms/metric_to_log.rs +++ b/src/transforms/metric_to_log.rs @@ -1,10 +1,10 @@ use chrono::Utc; -use lookup::{event_path, owned_value_path, path, PathPrefix}; use serde_json::Value; use std::collections::{BTreeMap, BTreeSet}; use vector_lib::codecs::MetricTagValues; use vector_lib::config::LogNamespace; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::{event_path, owned_value_path, path, PathPrefix}; use vector_lib::TimeZone; use vrl::path::OwnedValuePath; use vrl::value::kind::Collection; diff --git a/src/transforms/reduce/mod.rs b/src/transforms/reduce/mod.rs index 2270da1bb7b8b..bf6d4489ed91f 100644 --- a/src/transforms/reduce/mod.rs +++ b/src/transforms/reduce/mod.rs @@ -1,7 +1,5 @@ use futures::Stream; use indexmap::IndexMap; -use lookup::lookup_v2::parse_target_path; -use lookup::PathPrefix; use serde_with::serde_as; use std::collections::BTreeMap; use std::{ @@ -11,6 +9,8 @@ use std::{ time::{Duration, Instant}, }; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::lookup_v2::parse_target_path; +use vector_lib::lookup::PathPrefix; use crate::config::OutputId; use crate::{ @@ -478,7 +478,7 @@ mod test { use crate::event::{LogEvent, Value}; use crate::test_util::components::assert_transform_compliance; use crate::transforms::test::create_topology; - use lookup::owned_value_path; + use vector_lib::lookup::owned_value_path; #[test] fn generate_config() { diff --git a/src/transforms/remap.rs b/src/transforms/remap.rs index 88536c5380d33..97eb5d2d18927 100644 --- a/src/transforms/remap.rs +++ b/src/transforms/remap.rs @@ -6,12 +6,12 @@ use std::{ path::PathBuf, }; -use lookup::{metadata_path, owned_value_path, PathPrefix}; use snafu::{ResultExt, Snafu}; use vector_lib::codecs::MetricTagValues; use vector_lib::compile_vrl; use vector_lib::config::LogNamespace; use vector_lib::configurable::configurable_component; +use vector_lib::lookup::{metadata_path, owned_value_path, PathPrefix}; use vector_lib::schema::Definition; use vector_lib::TimeZone; use vector_vrl_functions::set_semantic_meaning::MeaningList;