From bf309b106f4c5d48c4fc0379dda8d3f5b28c7bb2 Mon Sep 17 00:00:00 2001 From: Daniel Czerwonk Date: Tue, 20 Jun 2017 18:30:54 +0200 Subject: [PATCH] fixed https://github.com/czerwonk/bird_exporter/issues/6 --- main.go | 2 +- parser.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 80dd21f..4c28b7e 100644 --- a/main.go +++ b/main.go @@ -11,7 +11,7 @@ import ( "github.com/prometheus/common/log" ) -const version string = "0.8.0" +const version string = "0.8.1" var ( showVersion = flag.Bool("version", false, "Print version information.") diff --git a/parser.go b/parser.go index d1403a1..da11538 100644 --- a/parser.go +++ b/parser.go @@ -19,7 +19,7 @@ var ( ) func init() { - protocolRegex, _ = regexp.Compile("^([^\\s]+)\\s+(BGP|OSPF)\\s+([^\\s]+)\\s+([^\\s]+)\\s+([^\\s]+)\\s+(.*?)\\s*$") + protocolRegex, _ = regexp.Compile("^(?:1002\\-)?([^\\s]+)\\s+(BGP|OSPF)\\s+([^\\s]+)\\s+([^\\s]+)\\s+([^\\s]+)\\s+(.*?)\\s*$") routeRegex, _ = regexp.Compile("^\\s+Routes:\\s+(\\d+) imported, (?:(\\d+) filtered, )?(\\d+) exported") uptimeRegex, _ = regexp.Compile("^(?:((\\d+):(\\d{2}):(\\d{2}))|\\d+)$") }