Skip to content
Merged
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
16 changes: 15 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,21 @@ func handleArguments() {

// buildFileName returns a filename to store the output of support collector.
func buildFileName() string {
return FilePrefix + "-" + time.Now().Format("20060102-1504") + ".zip"
return GetHostnameWithoutDomain() + "-" + FilePrefix + "-" + time.Now().Format("20060102-1504") + ".zip"
}

func GetHostnameWithoutDomain() string {
hostname, err := os.Hostname()
if err != nil {
logrus.Error(err)
}

result, _, found := strings.Cut(hostname, ".")
if !found {
return hostname
}

return result
}

func NewCollection(outputFile string) (*collection.Collection, func()) {
Expand Down