Skip to main content

codecs/
lib.rs

1//! A collection of codecs that can be used to transform between bytes streams /
2//! byte messages, byte frames and structured events.
3
4#![deny(missing_docs)]
5#![deny(warnings)]
6#![deny(clippy::unwrap_used)]
7
8mod common;
9mod decoder_framed_read;
10pub mod decoding;
11pub mod encoding;
12pub mod gelf;
13pub mod internal_events;
14mod ready_frames;
15
16pub use decoder_framed_read::DecoderFramedRead;
17pub use decoding::{
18    BytesDecoder, BytesDecoderConfig, BytesDeserializer, BytesDeserializerConfig,
19    CharacterDelimitedDecoder, CharacterDelimitedDecoderConfig, Decoder, DecodingConfig,
20    GelfDeserializer, GelfDeserializerConfig, JsonDeserializer, JsonDeserializerConfig,
21    LengthDelimitedDecoder, LengthDelimitedDecoderConfig, NativeDeserializer,
22    NativeDeserializerConfig, NativeJsonDeserializer, NativeJsonDeserializerConfig,
23    NewlineDelimitedDecoder, NewlineDelimitedDecoderConfig, OctetCountingDecoder,
24    OctetCountingDecoderConfig, StreamDecodingError, VarintLengthDelimitedDecoder,
25    VarintLengthDelimitedDecoderConfig,
26};
27#[cfg(feature = "syslog")]
28pub use decoding::{SyslogDeserializer, SyslogDeserializerConfig};
29#[cfg(feature = "arrow")]
30pub use encoding::{BatchEncoder, BatchSerializer};
31pub use encoding::{
32    BytesEncoder, BytesEncoderConfig, CharacterDelimitedEncoder, CharacterDelimitedEncoderConfig,
33    CsvSerializer, CsvSerializerConfig, Encoder, EncoderKind, EncodingConfig,
34    EncodingConfigWithFraming, GelfSerializer, GelfSerializerConfig, JsonSerializer,
35    JsonSerializerConfig, LengthDelimitedEncoder, LengthDelimitedEncoderConfig, LogfmtSerializer,
36    LogfmtSerializerConfig, NativeJsonSerializer, NativeJsonSerializerConfig, NativeSerializer,
37    NativeSerializerConfig, NewlineDelimitedEncoder, NewlineDelimitedEncoderConfig,
38    RawMessageSerializer, RawMessageSerializerConfig, SinkType, TextSerializer,
39    TextSerializerConfig, TimestampFormat, Transformer,
40};
41pub use gelf::{VALID_FIELD_REGEX, gelf_fields};
42pub use ready_frames::ReadyFrames;
43use vector_config_macros::configurable_component;
44
45/// The user configuration to choose the metric tag strategy.
46#[configurable_component]
47#[derive(Copy, Clone, Debug, PartialEq, Eq, Default)]
48#[serde(rename_all = "snake_case")]
49pub enum MetricTagValues {
50    /// Tag values are exposed as single strings, the same as they were before this config
51    /// option. Tags with multiple values show the last assigned value, and null values
52    /// are ignored.
53    #[default]
54    Single,
55    /// All tags are exposed as arrays of either string or null values.
56    Full,
57}