From d716ffb13e3e35378ef34ab0cd25ad0ebdce6f51 Mon Sep 17 00:00:00 2001 From: DustInDark Date: Thu, 9 Jun 2022 01:53:53 +0900 Subject: [PATCH] fixed output bug when not set option column #577 --- src/afterfact.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/afterfact.rs b/src/afterfact.rs index 32c40b35..e677ac76 100644 --- a/src/afterfact.rs +++ b/src/afterfact.rs @@ -414,7 +414,15 @@ enum ColPos { fn _get_serialized_disp_output(dispformat: Option) -> String { if dispformat.is_none() { - return "Timestamp|Computer|Channel|EventID|Level|RuleTitle|Details|RecordID|RecordInformation\n".to_string(); + let mut titles = vec!["Timestamp","Computer","Channel","EventID","Level","RuleTitle","Details"]; + let arg_match = &configs::CONFIG.read().unwrap().args; + if arg_match.is_present("display-record-id") { + titles.push("RecordID"); + } + if arg_match.is_present("full-data") { + titles.push("RecordInformation"); + } + return format!("{}\n", titles.join("|")); } let mut disp_serializer = csv::WriterBuilder::new() .double_quote(false)