Skip to content

Commit

Permalink
feat(main): to detect in record data, data cloned in json format #386
Browse files Browse the repository at this point in the history
  • Loading branch information
hitenkoku committed Jan 18, 2023
1 parent 8280694 commit b7a2656
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1153,8 +1153,12 @@ impl App {
continue;
}

let data = record_result.unwrap();
// println!("dbgjson: {:?}", data);
let data = &mut record_result.unwrap();
// ChannelなどのデータはEvent -> Systemに存在する必要があるが、他処理のことも考え、Event -> EventDataのデータをそのまま投入する形にした。cloneを利用しているのはCopy trait実装がserde_json::Valueにないため
data["Event"]["System"] = data["Event"]["EventData"].clone();
// Computer名に対応する内容はHostnameであることがわかったためデータをクローンして投入
data["Event"]["System"]["Computer"] =
data["Event"]["EventData"]["Hostname"].clone();
// channelがnullである場合とEventID Filter optionが指定されていない場合は、target_eventids.txtでイベントIDベースでフィルタする。
if !self._is_valid_channel(
&data,
Expand Down

0 comments on commit b7a2656

Please sign in to comment.