diff --git a/src/codecs/encoding/transformer.rs b/src/codecs/encoding/transformer.rs index bd5aee8b7f0bc..4e5ed9e195793 100644 --- a/src/codecs/encoding/transformer.rs +++ b/src/codecs/encoding/transformer.rs @@ -1,10 +1,12 @@ #![deny(missing_docs)] +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_config::configurable_component; use vector_core::event::{LogEvent, MaybeAsLogMut}; @@ -176,32 +178,46 @@ impl Transformer { } } + fn format_timestamps(&self, log: &mut LogEvent, extract: F) + where + F: Fn(&DateTime) -> T, + T: Into, + { + if log.value().is_object() { + let mut unix_timestamps = Vec::new(); + for (k, v) in log.all_event_fields().expect("must be an object") { + if let Value::Timestamp(ts) = v { + unix_timestamps.push((k.clone(), extract(ts).into())); + } + } + for (k, v) in unix_timestamps { + log.parse_path_and_insert(k, v).unwrap(); + } + } else { + // root is not an object + let timestamp = if let Value::Timestamp(ts) = log.value() { + Some(extract(ts)) + } else { + None + }; + if let Some(ts) = timestamp { + log.insert(event_path!(), ts.into()); + } + } + } + fn apply_timestamp_format(&self, log: &mut LogEvent) { if let Some(timestamp_format) = self.timestamp_format.as_ref() { match timestamp_format { - TimestampFormat::Unix => { - if log.value().is_object() { - let mut unix_timestamps = Vec::new(); - for (k, v) in log.all_event_fields().expect("must be an object") { - if let Value::Timestamp(ts) = v { - unix_timestamps.push((k.clone(), Value::Integer(ts.timestamp()))); - } - } - for (k, v) in unix_timestamps { - log.parse_path_and_insert(k, v).unwrap(); - } - } else { - // root is not an object - let timestamp = if let Value::Timestamp(ts) = log.value() { - Some(ts.timestamp()) - } else { - None - }; - if let Some(ts) = timestamp { - log.insert(event_path!(), Value::Integer(ts)); - } - } - } + TimestampFormat::Unix => self.format_timestamps(log, |ts| ts.timestamp()), + TimestampFormat::UnixMs => self.format_timestamps(log, |ts| ts.timestamp_millis()), + TimestampFormat::UnixUs => self.format_timestamps(log, |ts| ts.timestamp_micros()), + TimestampFormat::UnixNs => self.format_timestamps(log, |ts| { + ts.timestamp_nanos_opt().expect("Timestamp out of range") + }), + TimestampFormat::UnixFloat => self.format_timestamps(log, |ts| { + NotNan::new(ts.timestamp_micros() as f64 / 1e6).unwrap() + }), // RFC3339 is the default serialization of a timestamp. TimestampFormat::Rfc3339 => (), } @@ -225,7 +241,7 @@ impl Transformer { #[configurable_component] #[derive(Clone, Copy, Debug, Eq, PartialEq)] -#[serde(rename_all = "lowercase")] +#[serde(rename_all = "snake_case")] /// The format in which a timestamp should be represented. pub enum TimestampFormat { /// Represent the timestamp as a Unix timestamp. @@ -233,6 +249,18 @@ pub enum TimestampFormat { /// Represent the timestamp as a RFC 3339 timestamp. Rfc3339, + + /// Represent the timestamp as a Unix timestamp in milliseconds. + UnixMs, + + /// Represent the timestamp as a Unix timestamp in microseconds + UnixUs, + + /// Represent the timestamp as a Unix timestamp in nanoseconds. + UnixNs, + + /// Represent the timestamp as a Unix timestamp in floating point. + UnixFloat, } #[cfg(test)] @@ -344,9 +372,8 @@ mod tests { #[test] fn deserialize_and_transform_timestamp() { - let transformer: Transformer = toml::from_str(r#"timestamp_format = "unix""#).unwrap(); - let mut event = Event::Log(LogEvent::from("Demo")); - let timestamp = event + let mut base = Event::Log(LogEvent::from("Demo")); + let timestamp = base .as_mut_log() .get(( lookup::PathPrefix::Event, @@ -355,32 +382,44 @@ mod tests { .unwrap() .clone(); let timestamp = timestamp.as_timestamp().unwrap(); - event - .as_mut_log() + base.as_mut_log() .insert("another", Value::Timestamp(*timestamp)); - transformer.transform(&mut event); - - match event - .as_mut_log() - .get(( - lookup::PathPrefix::Event, - log_schema().timestamp_key().unwrap(), - )) - .unwrap() - { - Value::Integer(_) => {} - e => panic!( - "Timestamp was not transformed into a Unix timestamp. Was {:?}", - e + let cases = [ + ("unix", Value::from(timestamp.timestamp())), + ("unix_ms", Value::from(timestamp.timestamp_millis())), + ("unix_us", Value::from(timestamp.timestamp_micros())), + ( + "unix_ns", + Value::from(timestamp.timestamp_nanos_opt().unwrap()), ), - } - match event.as_mut_log().get("another").unwrap() { - Value::Integer(_) => {} - e => panic!( - "Timestamp was not transformed into a Unix timestamp. Was {:?}", - e + ( + "unix_float", + Value::from(timestamp.timestamp_micros() as f64 / 1e6), ), + ]; + for (fmt, expected) in cases { + let config: String = format!(r#"timestamp_format = "{}""#, fmt); + let transformer: Transformer = toml::from_str(&config).unwrap(); + let mut event = base.clone(); + transformer.transform(&mut event); + let log = event.as_mut_log(); + + for actual in [ + // original key + log.get(( + lookup::PathPrefix::Event, + log_schema().timestamp_key().unwrap(), + )) + .unwrap(), + // second key + log.get("another").unwrap(), + ] { + // type matches + assert_eq!(expected.kind_str(), actual.kind_str()); + // value matches + assert_eq!(&expected, actual); + } } } diff --git a/website/cue/reference/components/sinks.cue b/website/cue/reference/components/sinks.cue index 90df0f84ab518..9718fb3d094b4 100644 --- a/website/cue/reference/components/sinks.cue +++ b/website/cue/reference/components/sinks.cue @@ -252,8 +252,12 @@ components: sinks: [Name=string]: { type: string: { default: "rfc3339" enum: { - rfc3339: "Formats as a RFC3339 string" - unix: "Formats as a unix timestamp" + rfc3339: "Formats as a RFC3339 string" + unix: "Formats as a unix timestamp" + unix_ms: "Formats as a unix timestamp in milliseconds" + unix_us: "Formats as a unix timestamp in microseconds" + unix_ns: "Formats as a unix timestamp in nanoseconds" + unix_float: "Formats as a unix timestamp in floating point" } } } diff --git a/website/cue/reference/components/sinks/base/amqp.cue b/website/cue/reference/components/sinks/base/amqp.cue index a592e402c6f5d..11f861db46549 100644 --- a/website/cue/reference/components/sinks/base/amqp.cue +++ b/website/cue/reference/components/sinks/base/amqp.cue @@ -266,8 +266,12 @@ base: components: sinks: amqp: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/appsignal.cue b/website/cue/reference/components/sinks/base/appsignal.cue index 2eebeb475dc99..68904ee5046e6 100644 --- a/website/cue/reference/components/sinks/base/appsignal.cue +++ b/website/cue/reference/components/sinks/base/appsignal.cue @@ -109,8 +109,12 @@ base: components: sinks: appsignal: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/aws_cloudwatch_logs.cue b/website/cue/reference/components/sinks/base/aws_cloudwatch_logs.cue index 68e8b1614b1e4..fd8bebd59bdc0 100644 --- a/website/cue/reference/components/sinks/base/aws_cloudwatch_logs.cue +++ b/website/cue/reference/components/sinks/base/aws_cloudwatch_logs.cue @@ -437,8 +437,12 @@ base: components: sinks: aws_cloudwatch_logs: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/aws_kinesis_firehose.cue b/website/cue/reference/components/sinks/base/aws_kinesis_firehose.cue index f1a647e602fd5..3e4ac7c1d325b 100644 --- a/website/cue/reference/components/sinks/base/aws_kinesis_firehose.cue +++ b/website/cue/reference/components/sinks/base/aws_kinesis_firehose.cue @@ -416,8 +416,12 @@ base: components: sinks: aws_kinesis_firehose: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/aws_kinesis_streams.cue b/website/cue/reference/components/sinks/base/aws_kinesis_streams.cue index f723f9e8ad5b2..a2a7a659b8b46 100644 --- a/website/cue/reference/components/sinks/base/aws_kinesis_streams.cue +++ b/website/cue/reference/components/sinks/base/aws_kinesis_streams.cue @@ -416,8 +416,12 @@ base: components: sinks: aws_kinesis_streams: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/aws_s3.cue b/website/cue/reference/components/sinks/base/aws_s3.cue index 16b10bc9018bc..5e6e0fef81491 100644 --- a/website/cue/reference/components/sinks/base/aws_s3.cue +++ b/website/cue/reference/components/sinks/base/aws_s3.cue @@ -525,8 +525,12 @@ base: components: sinks: aws_s3: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/aws_sns.cue b/website/cue/reference/components/sinks/base/aws_sns.cue index 1cf31e8956d8c..81b67a6c45565 100644 --- a/website/cue/reference/components/sinks/base/aws_sns.cue +++ b/website/cue/reference/components/sinks/base/aws_sns.cue @@ -352,8 +352,12 @@ base: components: sinks: aws_sns: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/aws_sqs.cue b/website/cue/reference/components/sinks/base/aws_sqs.cue index cb7b1dcd79a9e..28e012cc9a1a5 100644 --- a/website/cue/reference/components/sinks/base/aws_sqs.cue +++ b/website/cue/reference/components/sinks/base/aws_sqs.cue @@ -352,8 +352,12 @@ base: components: sinks: aws_sqs: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/azure_blob.cue b/website/cue/reference/components/sinks/base/azure_blob.cue index a56680098c0fc..34d92a850d390 100644 --- a/website/cue/reference/components/sinks/base/azure_blob.cue +++ b/website/cue/reference/components/sinks/base/azure_blob.cue @@ -379,8 +379,12 @@ base: components: sinks: azure_blob: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/azure_monitor_logs.cue b/website/cue/reference/components/sinks/base/azure_monitor_logs.cue index 6f1017a90a93a..e9f4c16b7e31f 100644 --- a/website/cue/reference/components/sinks/base/azure_monitor_logs.cue +++ b/website/cue/reference/components/sinks/base/azure_monitor_logs.cue @@ -95,8 +95,12 @@ base: components: sinks: azure_monitor_logs: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/clickhouse.cue b/website/cue/reference/components/sinks/base/clickhouse.cue index 6be7c94fa2a6c..acd2cafb2c588 100644 --- a/website/cue/reference/components/sinks/base/clickhouse.cue +++ b/website/cue/reference/components/sinks/base/clickhouse.cue @@ -166,8 +166,12 @@ base: components: sinks: clickhouse: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/console.cue b/website/cue/reference/components/sinks/base/console.cue index 9ebd1a606fd5b..c2a69fbc13dc2 100644 --- a/website/cue/reference/components/sinks/base/console.cue +++ b/website/cue/reference/components/sinks/base/console.cue @@ -250,8 +250,12 @@ base: components: sinks: console: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/databend.cue b/website/cue/reference/components/sinks/base/databend.cue index 6089ca255071d..8bc2434cbb1b7 100644 --- a/website/cue/reference/components/sinks/base/databend.cue +++ b/website/cue/reference/components/sinks/base/databend.cue @@ -269,8 +269,12 @@ base: components: sinks: databend: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/datadog_logs.cue b/website/cue/reference/components/sinks/base/datadog_logs.cue index 7de6e0a300989..1858aab1659eb 100644 --- a/website/cue/reference/components/sinks/base/datadog_logs.cue +++ b/website/cue/reference/components/sinks/base/datadog_logs.cue @@ -118,8 +118,12 @@ base: components: sinks: datadog_logs: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/elasticsearch.cue b/website/cue/reference/components/sinks/base/elasticsearch.cue index 98b9dbdeff3a6..9e0041fcdd068 100644 --- a/website/cue/reference/components/sinks/base/elasticsearch.cue +++ b/website/cue/reference/components/sinks/base/elasticsearch.cue @@ -400,8 +400,12 @@ base: components: sinks: elasticsearch: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/file.cue b/website/cue/reference/components/sinks/base/file.cue index 590a6fb945d22..d56bfb50db925 100644 --- a/website/cue/reference/components/sinks/base/file.cue +++ b/website/cue/reference/components/sinks/base/file.cue @@ -270,8 +270,12 @@ base: components: sinks: file: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/gcp_chronicle_unstructured.cue b/website/cue/reference/components/sinks/base/gcp_chronicle_unstructured.cue index 5a049cd6f6ab2..0c5ab5adf1115 100644 --- a/website/cue/reference/components/sinks/base/gcp_chronicle_unstructured.cue +++ b/website/cue/reference/components/sinks/base/gcp_chronicle_unstructured.cue @@ -319,8 +319,12 @@ base: components: sinks: gcp_chronicle_unstructured: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/gcp_cloud_storage.cue b/website/cue/reference/components/sinks/base/gcp_cloud_storage.cue index 47f6bf3b03df7..d28a12a3693c7 100644 --- a/website/cue/reference/components/sinks/base/gcp_cloud_storage.cue +++ b/website/cue/reference/components/sinks/base/gcp_cloud_storage.cue @@ -403,8 +403,12 @@ base: components: sinks: gcp_cloud_storage: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/gcp_pubsub.cue b/website/cue/reference/components/sinks/base/gcp_pubsub.cue index 0b36642444576..c2b12e0240170 100644 --- a/website/cue/reference/components/sinks/base/gcp_pubsub.cue +++ b/website/cue/reference/components/sinks/base/gcp_pubsub.cue @@ -317,8 +317,12 @@ base: components: sinks: gcp_pubsub: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/gcp_stackdriver_logs.cue b/website/cue/reference/components/sinks/base/gcp_stackdriver_logs.cue index d1ab258d3ffe9..291261fe47866 100644 --- a/website/cue/reference/components/sinks/base/gcp_stackdriver_logs.cue +++ b/website/cue/reference/components/sinks/base/gcp_stackdriver_logs.cue @@ -118,8 +118,12 @@ base: components: sinks: gcp_stackdriver_logs: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/honeycomb.cue b/website/cue/reference/components/sinks/base/honeycomb.cue index b6a9c623df8cd..9b762b95e873b 100644 --- a/website/cue/reference/components/sinks/base/honeycomb.cue +++ b/website/cue/reference/components/sinks/base/honeycomb.cue @@ -87,8 +87,12 @@ base: components: sinks: honeycomb: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/http.cue b/website/cue/reference/components/sinks/base/http.cue index 58fcd9c005c81..4f2733fba9158 100644 --- a/website/cue/reference/components/sinks/base/http.cue +++ b/website/cue/reference/components/sinks/base/http.cue @@ -358,8 +358,12 @@ base: components: sinks: http: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/humio_logs.cue b/website/cue/reference/components/sinks/base/humio_logs.cue index 2892e356c6784..74fe040a84fcb 100644 --- a/website/cue/reference/components/sinks/base/humio_logs.cue +++ b/website/cue/reference/components/sinks/base/humio_logs.cue @@ -311,8 +311,12 @@ base: components: sinks: humio_logs: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/influxdb_logs.cue b/website/cue/reference/components/sinks/base/influxdb_logs.cue index bf00f976c0b68..3dafc496d1e02 100644 --- a/website/cue/reference/components/sinks/base/influxdb_logs.cue +++ b/website/cue/reference/components/sinks/base/influxdb_logs.cue @@ -104,8 +104,12 @@ base: components: sinks: influxdb_logs: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/kafka.cue b/website/cue/reference/components/sinks/base/kafka.cue index fd95ee383b816..e68f12ae52fe5 100644 --- a/website/cue/reference/components/sinks/base/kafka.cue +++ b/website/cue/reference/components/sinks/base/kafka.cue @@ -305,8 +305,12 @@ base: components: sinks: kafka: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/logdna.cue b/website/cue/reference/components/sinks/base/logdna.cue index 7dcd6cb736421..2067a596cbc33 100644 --- a/website/cue/reference/components/sinks/base/logdna.cue +++ b/website/cue/reference/components/sinks/base/logdna.cue @@ -100,8 +100,12 @@ base: components: sinks: logdna: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/loki.cue b/website/cue/reference/components/sinks/base/loki.cue index fe7a9160bc88b..c44bc390a0c1a 100644 --- a/website/cue/reference/components/sinks/base/loki.cue +++ b/website/cue/reference/components/sinks/base/loki.cue @@ -362,8 +362,12 @@ base: components: sinks: loki: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/mezmo.cue b/website/cue/reference/components/sinks/base/mezmo.cue index cf4ce6e40a8e5..f4e0b59357fa6 100644 --- a/website/cue/reference/components/sinks/base/mezmo.cue +++ b/website/cue/reference/components/sinks/base/mezmo.cue @@ -100,8 +100,12 @@ base: components: sinks: mezmo: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/nats.cue b/website/cue/reference/components/sinks/base/nats.cue index 11d3dc126fa7d..836ab584fcc33 100644 --- a/website/cue/reference/components/sinks/base/nats.cue +++ b/website/cue/reference/components/sinks/base/nats.cue @@ -350,8 +350,12 @@ base: components: sinks: nats: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/new_relic.cue b/website/cue/reference/components/sinks/base/new_relic.cue index 1929466c31c80..1adcd87c1e0d8 100644 --- a/website/cue/reference/components/sinks/base/new_relic.cue +++ b/website/cue/reference/components/sinks/base/new_relic.cue @@ -123,8 +123,12 @@ base: components: sinks: new_relic: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/papertrail.cue b/website/cue/reference/components/sinks/base/papertrail.cue index 6f0e9d17eb439..7a9d7172cd514 100644 --- a/website/cue/reference/components/sinks/base/papertrail.cue +++ b/website/cue/reference/components/sinks/base/papertrail.cue @@ -250,8 +250,12 @@ base: components: sinks: papertrail: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/pulsar.cue b/website/cue/reference/components/sinks/base/pulsar.cue index 428c4f42791e0..d866b1916cab1 100644 --- a/website/cue/reference/components/sinks/base/pulsar.cue +++ b/website/cue/reference/components/sinks/base/pulsar.cue @@ -344,8 +344,12 @@ base: components: sinks: pulsar: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/redis.cue b/website/cue/reference/components/sinks/base/redis.cue index 6d2e1964de935..7c39ffc442c46 100644 --- a/website/cue/reference/components/sinks/base/redis.cue +++ b/website/cue/reference/components/sinks/base/redis.cue @@ -303,8 +303,12 @@ base: components: sinks: redis: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/sematext_logs.cue b/website/cue/reference/components/sinks/base/sematext_logs.cue index 46c6b46875306..31ac3952b4bfd 100644 --- a/website/cue/reference/components/sinks/base/sematext_logs.cue +++ b/website/cue/reference/components/sinks/base/sematext_logs.cue @@ -77,8 +77,12 @@ base: components: sinks: sematext_logs: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/socket.cue b/website/cue/reference/components/sinks/base/socket.cue index 99c353f604166..a05ffec17f6f0 100644 --- a/website/cue/reference/components/sinks/base/socket.cue +++ b/website/cue/reference/components/sinks/base/socket.cue @@ -262,8 +262,12 @@ base: components: sinks: socket: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/splunk_hec_logs.cue b/website/cue/reference/components/sinks/base/splunk_hec_logs.cue index e79d4cdb46261..f105e81aad584 100644 --- a/website/cue/reference/components/sinks/base/splunk_hec_logs.cue +++ b/website/cue/reference/components/sinks/base/splunk_hec_logs.cue @@ -361,8 +361,12 @@ base: components: sinks: splunk_hec_logs: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/webhdfs.cue b/website/cue/reference/components/sinks/base/webhdfs.cue index 0dd49a0d683b8..e85dc6de61bf1 100644 --- a/website/cue/reference/components/sinks/base/webhdfs.cue +++ b/website/cue/reference/components/sinks/base/webhdfs.cue @@ -311,8 +311,12 @@ base: components: sinks: webhdfs: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } } diff --git a/website/cue/reference/components/sinks/base/websocket.cue b/website/cue/reference/components/sinks/base/websocket.cue index c9c30e5e170ec..1f3835e123d3e 100644 --- a/website/cue/reference/components/sinks/base/websocket.cue +++ b/website/cue/reference/components/sinks/base/websocket.cue @@ -297,8 +297,12 @@ base: components: sinks: websocket: configuration: { description: "Format used for timestamp fields." required: false type: string: enum: { - rfc3339: "Represent the timestamp as a RFC 3339 timestamp." - unix: "Represent the timestamp as a Unix timestamp." + rfc3339: "Represent the timestamp as a RFC 3339 timestamp." + unix: "Represent the timestamp as a Unix timestamp." + unix_float: "Represent the timestamp as a Unix timestamp in floating point." + unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds." + unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds." + unix_us: "Represent the timestamp as a Unix timestamp in microseconds" } } }