Skip to content

Commit

Permalink
chore(codecs): Update syslog_loose to properly handle escapes (vector…
Browse files Browse the repository at this point in the history
…dotdev#18114)

* Update syslog_loose to properly handle escapes

Signed-off-by: Stephen Wakely <[email protected]>

* fmt

Signed-off-by: Stephen Wakely <[email protected]>

---------

Signed-off-by: Stephen Wakely <[email protected]>
  • Loading branch information
StephenWakely authored Jul 31, 2023
1 parent a06c711 commit b009e4d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
14 changes: 12 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/codecs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ serde = { version = "1", default-features = false, features = ["derive"] }
serde_json = { version = "1", default-features = false }
smallvec = { version = "1", default-features = false, features = ["union"] }
snafu = { version = "0.7.5", default-features = false, features = ["futures"] }
syslog_loose = { version = "0.18", default-features = false, optional = true }
syslog_loose = { version = "0.19", default-features = false, optional = true }
tokio-util = { version = "0.7", default-features = false, features = ["codec"] }
tracing = { version = "0.1", default-features = false }
vrl.workspace = true
Expand Down
5 changes: 3 additions & 2 deletions lib/codecs/src/decoding/format/syslog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use lookup::{event_path, owned_value_path, OwnedTargetPath, OwnedValuePath};
use smallvec::{smallvec, SmallVec};
use std::borrow::Cow;
use std::collections::BTreeMap;
use syslog_loose::{IncompleteDate, Message, ProcId, Protocol};
use syslog_loose::{IncompleteDate, Message, ProcId, Protocol, Variant};
use vector_config::configurable_component;
use vector_core::config::{LegacyKey, LogNamespace};
use vector_core::{
Expand Down Expand Up @@ -282,7 +282,8 @@ impl Deserializer for SyslogDeserializer {
false => Cow::from(std::str::from_utf8(&bytes)?),
};
let line = line.trim();
let parsed = syslog_loose::parse_message_with_year_exact(line, resolve_year)?;
let parsed =
syslog_loose::parse_message_with_year_exact(line, resolve_year, Variant::Either)?;

let log = match (self.source, log_namespace) {
(Some(source), LogNamespace::Vector) => {
Expand Down

0 comments on commit b009e4d

Please sign in to comment.