Skip to content

Commit

Permalink
fix: lowercasify all field names before check
Browse files Browse the repository at this point in the history
  • Loading branch information
de-sh committed Dec 20, 2024
1 parent 6dd2448 commit 6a0611c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/event/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use super::{DEFAULT_METADATA_KEY, DEFAULT_TAGS_KEY, DEFAULT_TIMESTAMP_KEY};
pub mod json;

// Prefixes that are most common in datetime field names
const TIME_FIELD_PREFIXS: [&str; 2] = ["date", "time"];
const TIME_FIELD_PREFIXES: [&str; 2] = ["date", "time"];

type Tags = String;
type Metadata = String;
Expand Down Expand Up @@ -235,7 +235,9 @@ fn detect_and_override_timestamp_fields(
.map(|field| {
if !existing_field_names.contains(&field.name())
&& field.data_type() == &DataType::Utf8
&& TIME_FIELD_PREFIXS.iter().any(|p| field.name().contains(p))
&& TIME_FIELD_PREFIXES
.iter()
.any(|p| field.name().to_lowercase().contains(p))
&& log_records
.iter()
.any(|record| matches_date_time_field(field.name(), record))
Expand Down

0 comments on commit 6a0611c

Please sign in to comment.