1 Star 0 Fork 0

sqos/beats

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
testing.go 495 Bytes
Copy Edit Raw Blame History
package elasticsearch
import "os"
func GetEnvHost() string {
host := os.Getenv("ES_HOST")
if len(host) == 0 {
host = "127.0.0.1"
}
return host
}
func GetEnvPort() string {
port := os.Getenv("ES_PORT")
if len(port) == 0 {
port = "9200"
}
return port
}
func GetConfig(metricset string) map[string]interface{} {
return map[string]interface{}{
"module": "elasticsearch",
"metricsets": []string{metricset},
"hosts": []string{GetEnvHost() + ":" + GetEnvPort()},
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sqos/beats.git
git@gitee.com:sqos/beats.git
sqos
beats
beats
v6.2.4

Search