|
@@ -172,11 +172,12 @@ func apacheLogCapture(logfile string) {
|
|
|
var virtualHost string
|
|
|
vhost := logEntry.VirtualHost
|
|
|
if vhost != "" {
|
|
|
- vhostAndPort := strings.Split(logEntry.VirtualHost, ":")
|
|
|
+ vhostAndPort := strings.Split(vhost, ":")
|
|
|
virtualHost = vhostAndPort[0]
|
|
|
|
|
|
if config.UseVhostAsSource {
|
|
|
- virtualHost = virtualHost[0:strings.Index(virtualHost, ",")]
|
|
|
+ vhosts := strings.Split(vhost, ",")
|
|
|
+ virtualHost = strings.TrimSpace(vhosts[0])
|
|
|
vhIP := net.ParseIP(virtualHost)
|
|
|
if vhIP != nil {
|
|
|
remote = virtualHost
|