From 834b2708f44fa5a9cc0b3a83815bd5c697ec9b3e Mon Sep 17 00:00:00 2001 From: ruflin Date: Wed, 22 Mar 2017 13:06:02 +0100 Subject: [PATCH] Make http fields in HAProxy optional to improve compatibility with 1.5 It seems the http fields do not always exists in HAProxy 1.5. We currently only support 1.6 but as this will not break things, I made the fields optional for better compatibility. --- metricbeat/module/haproxy/stat/data.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/metricbeat/module/haproxy/stat/data.go b/metricbeat/module/haproxy/stat/data.go index 89579931d0a..68892716486 100644 --- a/metricbeat/module/haproxy/stat/data.go +++ b/metricbeat/module/haproxy/stat/data.go @@ -49,12 +49,12 @@ var ( "time.avg": c.Int("Rtime", s.Optional), "denied": c.Int("Dresp"), "http": s.Object{ - "1xx": c.Int("Hrsp1xx"), - "2xx": c.Int("Hrsp2xx"), - "3xx": c.Int("Hrsp3xx"), - "4xx": c.Int("Hrsp4xx"), - "5xx": c.Int("Hrsp5xx"), - "other": c.Int("HrspOther"), + "1xx": c.Int("Hrsp1xx", s.Optional), + "2xx": c.Int("Hrsp2xx", s.Optional), + "3xx": c.Int("Hrsp3xx", s.Optional), + "4xx": c.Int("Hrsp4xx", s.Optional), + "5xx": c.Int("Hrsp5xx", s.Optional), + "other": c.Int("HrspOther", s.Optional), }, },