Skip to content

Commit

Permalink
feat: add multi line option
Browse files Browse the repository at this point in the history
  • Loading branch information
fukusuket committed Nov 12, 2024
1 parent 89f453f commit 90ed4e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/detections/configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ impl StoredStatic {
let multiline_flag = match &input_config.as_ref().unwrap().action {
Some(Action::CsvTimeline(opt)) => opt.multiline,
Some(Action::Search(opt)) => opt.multiline,
Some(Action::LogMetrics(opt)) => opt.multiline,
_ => false,
};
let proven_rule_flag = match &input_config.as_ref().unwrap().action {
Expand Down Expand Up @@ -1769,6 +1770,10 @@ pub struct LogMetricsOption {
#[clap(flatten)]
pub time_format_options: TimeFormatOptions,

/// Output event field information in multiple rows for CSV output
#[arg(help_heading = Some("Output"), short = 'M', long="multiline", display_order = 390)]
pub multiline: bool,

/// Overwrite files when saving
#[arg(help_heading = Some("General Options"), short='C', long = "clobber", display_order = 290, requires = "output")]
pub clobber: bool,
Expand Down
5 changes: 5 additions & 0 deletions src/timeline/timelines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,11 @@ impl Timeline {
{
return None;
}
let sep = if stored_static.multiline_flag {
"\n"
} else {
sep
};
let ab_ch: Vec<String> = rec
.channels
.iter()
Expand Down

0 comments on commit 90ed4e1

Please sign in to comment.