|
@@ -281,7 +281,10 @@ func nginxLogCapture(logfile, format string) {
|
|
if config.UseXForwardedAsSource {
|
|
if config.UseXForwardedAsSource {
|
|
xff, err := logEntry.Field("http_x_forwarded_for")
|
|
xff, err := logEntry.Field("http_x_forwarded_for")
|
|
if err != nil && xff != "" {
|
|
if err != nil && xff != "" {
|
|
- remote = xff
|
|
|
|
|
|
+ ips := strings.Split(xff, ",")
|
|
|
|
+ if len(ips) > 0 {
|
|
|
|
+ remote = strings.TrimSpace(ips[0])
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|