diff --git a/conf/configuration.go b/conf/configuration.go index 6723850..c6b58df 100644 --- a/conf/configuration.go +++ b/conf/configuration.go @@ -45,6 +45,8 @@ func Init() { viper.SetDefault("message.byte-per-sec", 200) viper.SetDefault("message.max-random-hosts", 1000) viper.SetDefault("message.max-random-apps", 100) + viper.SetDefault("message.host", "hostname") + viper.SetDefault("message.appname", "appname") viper.SetDefault("api.addr", ":11000") viper.SetDefault("api.basePath", "/") diff --git a/formats/syslog/syslog.go b/formats/syslog/syslog.go index 7405764..48c0553 100644 --- a/formats/syslog/syslog.go +++ b/formats/syslog/syslog.go @@ -64,8 +64,8 @@ func SampleData() TemplateData { Facility: 20, severity: 5, dateTime: time.Date(2011, 6, 25, 20, 0, 4, 0, time.UTC), - Host: "hostname", - AppName: "appname", + Host: viper.GetString("message.host"), + AppName: viper.GetString("message.appname"), PID: 1143, Seq: 1, Msg: "An application event log entry...",