diff --git a/plugins/inputs/system/cpu.go b/plugins/inputs/system/cpu.go index bef2a28f4..333339458 100644 --- a/plugins/inputs/system/cpu.go +++ b/plugins/inputs/system/cpu.go @@ -113,6 +113,10 @@ func totalCpuTime(t cpu.CPUTimesStat) float64 { func init() { inputs.Add("cpu", func() telegraf.Input { - return &CPUStats{ps: &systemPS{}} + return &CPUStats{ + PerCPU: true, + TotalCPU: true, + ps: &systemPS{}, + } }) } diff --git a/plugins/outputs/file/file.go b/plugins/outputs/file/file.go index e593e3cea..743c0f03f 100644 --- a/plugins/outputs/file/file.go +++ b/plugins/outputs/file/file.go @@ -36,6 +36,11 @@ func (f *File) SetSerializer(serializer serializers.Serializer) { func (f *File) Connect() error { writers := []io.Writer{} + + if len(f.Files) == 0 { + f.Files = []string{"stdout"} + } + for _, file := range f.Files { if file == "stdout" { writers = append(writers, os.Stdout)