From fdfbacec309a193ab3d4f10ddf691f5a668ddef2 Mon Sep 17 00:00:00 2001 From: Eric Holt Date: Tue, 28 Sep 2021 21:25:27 -0400 Subject: [PATCH] Handle second {} in http log entry if present --- CHANGELOG.md | 8 ++++++++ plugins/haproxy.yaml | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0753c8cf..b52c5c7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.0.83] Unreleased + +### Changed + +- HAProxy: Handle issue where http logs might fail if extra field is present [PR346](https://github.com/observIQ/stanza-plugins/pull/346) + +### Fixed + ## [0.0.82] 2021-09-28 ### Fixed diff --git a/plugins/haproxy.yaml b/plugins/haproxy.yaml index 4ef3a8d0..e67c3100 100644 --- a/plugins/haproxy.yaml +++ b/plugins/haproxy.yaml @@ -1,4 +1,4 @@ -version: 0.0.1 +version: 0.0.2 title: HAProxy description: Log parser for HAProxy supported_platforms: @@ -72,7 +72,7 @@ pipeline: - id: httplog_parser type: regex_parser parse_from: $record.message - regex: '^(\s)?(?P[^:]+):(?P[^\s]+)\s+\[(?P[^\]]+)\]\s+(?P[^\s]+)\s+(?P[^/]+)/(?P[^\s]+)\s+(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^\s]+)\s+(?P[^\s]+)\s+(?P[^\s]+)\s+(?P[^\s]+)\s+(?P[^\s]+)\s+(?P[\w-]{4})\s+(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^\s]+)\s+(?P[^/]+)/(?P[^\s]+) ({[\w\d[:ascii:]]+?}\s)?"(?P\S+) +(?P[^ ]*)( (?P[^/]*)/(?P[^\"]*)|[^\"]*)?"' + regex: '^(\s)?(?P[^:]+):(?P[^\s]+)\s+\[(?P[^\]]+)\]\s+(?P[^\s]+)\s+(?P[^/]+)/(?P[^\s]+)\s+(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^\s]+)\s+(?P[^\s]+)\s+(?P[^\s]+)\s+(?P[^\s]+)\s+(?P[^\s]+)\s+(?P[\w-]{4})\s+(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^\s]+)\s+(?P[^/]+)/(?P[^\s]+) ({[\w\d[:ascii:]]+}\s)?({[\w\d[:ascii:]]+}\s)?"(?P\S+) +(?P[^ ]*)( (?P[^/]*)/(?P[^\"]*)|[^\"]*)?"' output: frontend_type_http_add - id: frontend_type_http_add