diff --git a/agent.go b/agent.go index ce8bb9b2b401f..ef687bd308777 100644 --- a/agent.go +++ b/agent.go @@ -86,7 +86,7 @@ func (a *Agent) Connect() error { } _, err = c.Query(client.Query{ - Command: fmt.Sprintf("CREATE DATABASE telegraf"), + Command: fmt.Sprintf("CREATE DATABASE %s", config.Database), }) if err != nil && !strings.Contains(err.Error(), "database already exists") {