Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
심승용 committed May 17, 2020
1 parent 44b62d0 commit 7dfa1b6
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions beater/lsbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,6 @@ func listDir(dirName string, bt *Lsbeat, b *beat.Beat, depth int) (int64, int, i
return curDir.Size(), 0, 0
}

folderinfo := common.MapStr{
"name": curDir.Name(),
"size": curDir.Size(),
"modTime": curDir.ModTime(),
}

files, _ := ioutil.ReadDir(dirName)

fileinfos := []common.MapStr{}
Expand Down Expand Up @@ -138,12 +132,20 @@ func listDir(dirName string, bt *Lsbeat, b *beat.Beat, depth int) (int64, int, i
filecountAcc += filecount
subfoldercountAcc += subfoldercount

folderinfo := common.MapStr{
"name": curDir.Name(),
"size": dirSize,
"modTime": curDir.ModTime(),
"depth": bt.depth - depth,
"maxDepth": bt.depth,
}

eventDir := beat.Event{
Timestamp: time.Now(),
Fields: common.MapStr{
"folder": folderinfo,
"dirName": dirName,
"dirSizeOld": dirSize,
"dirSize": dirSize,
"dirSizeAccumulate": dirSizeAcc,
"filesCount": filecount,
"filesCountAccumulate": filecountAcc,
Expand Down

0 comments on commit 7dfa1b6

Please sign in to comment.