Add port tag to apache plugin
This commit is contained in:
parent
0700e0cf94
commit
5657e8d1da
|
@ -134,13 +134,11 @@ func (n *Apache) gatherScores(data string, acc plugins.Accumulator, tags map[str
|
||||||
// Get tag(s) for the apache plugin
|
// Get tag(s) for the apache plugin
|
||||||
func getTags(addr *url.URL) map[string]string {
|
func getTags(addr *url.URL) map[string]string {
|
||||||
h := addr.Host
|
h := addr.Host
|
||||||
var htag string
|
if host, port, err := net.SplitHostPort(h); err == nil {
|
||||||
if host, _, err := net.SplitHostPort(h); err == nil {
|
return map[string]string{"server": host, "port": port}
|
||||||
htag = host
|
|
||||||
} else {
|
} else {
|
||||||
htag = h
|
return map[string]string{"server": h, "port": "80"}
|
||||||
}
|
}
|
||||||
return map[string]string{"server": htag}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
Loading…
Reference in New Issue