diff --git a/Cargo.lock b/Cargo.lock index dc5ee98..89c6332 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2452,6 +2452,15 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-segmentation" version = "1.8.0" @@ -2584,6 +2593,7 @@ dependencies = [ "tokio", "tracing", "tracing-subscriber", + "unicase", ] [[package]] diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 6978633..bb2d4a4 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -29,6 +29,7 @@ once_cell = "1.8.0" regex = "1.5.4" thiserror = "1.0.26" tracing = "0.1.26" +unicase = "2.6.0" [dependencies.command-group] version = "1.0.5" diff --git a/lib/src/filter/tagged.rs b/lib/src/filter/tagged.rs index 2412d62..85909c8 100644 --- a/lib/src/filter/tagged.rs +++ b/lib/src/filter/tagged.rs @@ -5,6 +5,7 @@ use std::sync::Arc; use globset::GlobMatcher; use regex::Regex; use tracing::{debug, trace, warn}; +use unicase::UniCase; use crate::error::RuntimeError; use crate::event::{Event, Tag}; @@ -180,8 +181,8 @@ impl Filter { trace!(op=?self.op, pat=?self.pat, ?subject, "performing filter match"); Ok(match (self.op, &self.pat) { - (Op::Equal, Pattern::Exact(pat)) => subject == pat, - (Op::NotEqual, Pattern::Exact(pat)) => subject != pat, + (Op::Equal, Pattern::Exact(pat)) => UniCase::new(subject) == UniCase::new(pat), + (Op::NotEqual, Pattern::Exact(pat)) => UniCase::new(subject) != UniCase::new(pat), (Op::Regex, Pattern::Regex(pat)) => pat.is_match(subject), (Op::NotRegex, Pattern::Regex(pat)) => !pat.is_match(subject), (Op::Glob, Pattern::Glob(pat)) => pat.is_match(subject),