From 486429ac9d0d37fe67e4385028151a61ae33b9da Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Apr 24 2021 19:06:04 +0000 Subject: Try to fix an issue with the regex which was not matching many lines The issue seems to be that r'(?P(libdnf(?:/(?P\S+)))|rpm-ostree?)\s+' fails to match data on lines like "libdnf (Red Hat Enterprise Linux 8.4; generic; Linux.x86_64)" "rpm-ostree/2020.5" "libdnf/2020 (Red Hat Enterprise Linux 8.4; generic; Linux.x86_64)" "rpm-ostree (Red Hat Enterprise Linux 8.4; generic; Linux.x86_64)" Changing it to r'(?P(libdnf|rpm-ostree)(?:/(?P\S+))?)\s+' gave data. Signed-off-by: Stephen Smoogen --- diff --git a/countme/regex.py b/countme/regex.py index dfe7514..ee7fd29 100644 --- a/countme/regex.py +++ b/countme/regex.py @@ -105,7 +105,7 @@ LOG_PATTERN_FIELDS = { # For more info on the User-Agent header, see RFC7231, Section 5.5.3: # https://tools.ietf.org/html/rfc7231#section-5.5.3) COUNTME_USER_AGENT_PATTERN = ( - r'(?P(libdnf(?:/(?P\S+)))|rpm-ostree?)\s+' + r'(?P(libdnf|rpm-ostree)(?:/(?P\S+))?)\s+' r'\(' r'(?P.*)\s' r'(?P[0-9a-z._-]*?);\s' diff --git a/countme/version.py b/countme/version.py index 5048df3..eb46507 100644 --- a/countme/version.py +++ b/countme/version.py @@ -1,2 +1,2 @@ -__version__ = "0.0.3" +__version__ = "0.0.4" __version_info__ = tuple(__version__.split('.')) diff --git a/mirrors-countme.spec b/mirrors-countme.spec index 8950316..b214ee0 100644 --- a/mirrors-countme.spec +++ b/mirrors-countme.spec @@ -3,7 +3,7 @@ %global modname countme Name: python-%{srcname} -Version: 0.0.3 +Version: 0.0.4 Release: 1%{?dist} Summary: access_log parsing & host counting for DNF mirrors URL: https://pagure.io/mirrors-countme