Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,5 @@ func init() {
analyzeCmd.Flags().StringSliceVarP(&opt.Regions, "region", "r", []string{}, "target region")
analyzeCmd.Flags().BoolVarP(&opt.AllAccounts, "all-accounts", "A", false, "all accounts")
analyzeCmd.Flags().BoolVarP(&opt.AllRegions, "all-regions", "R", false, "all regions")
analyzeCmd.Flags().StringVarP(&opt.LogFilePrefix, "log-file-prefix", "p", "", "log file prefix")
}
1 change: 1 addition & 0 deletions cmd/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ func init() {
eventsCmd.Flags().StringSliceVarP(&opt.Regions, "region", "r", []string{}, "target region")
eventsCmd.Flags().BoolVarP(&opt.AllAccounts, "all-accounts", "A", false, "all accounts")
eventsCmd.Flags().BoolVarP(&opt.AllRegions, "all-regions", "R", false, "all regions")
eventsCmd.Flags().StringVarP(&opt.LogFilePrefix, "log-file-prefix", "p", "", "log file prefix")
}
1 change: 1 addition & 0 deletions cmd/size.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,5 @@ func init() {
sizeCmd.Flags().StringSliceVarP(&opt.Regions, "region", "r", []string{}, "target region")
sizeCmd.Flags().BoolVarP(&opt.AllAccounts, "all-accounts", "A", false, "all accounts")
sizeCmd.Flags().BoolVarP(&opt.AllRegions, "all-regions", "R", false, "all regions")
sizeCmd.Flags().StringVarP(&opt.LogFilePrefix, "log-file-prefix", "p", "", "log file prefix")
}
4 changes: 4 additions & 0 deletions trail/trail.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ type Option struct {
Regions []string
AllAccounts bool
AllRegions bool
LogFilePrefix string
}

type WalkEventsFunc func(r *Record) error
Expand Down Expand Up @@ -231,6 +232,9 @@ func generatePrefixes(sess *session.Session, dsn string, opt Option, after1Day b
}
bucket := splitted[0]
prefix := "AWSLogs"
if opt.LogFilePrefix != "" {
prefix = fmt.Sprintf("%s/%s", opt.LogFilePrefix, prefix)
}
if len(splitted) > 1 && splitted[1] != "" {
prefix = splitted[1]
}
Expand Down