Bug 1541948 - RFE: Allow regular expressions in curator settings
Summary: RFE: Allow regular expressions in curator settings
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Logging
Version: 3.7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.7.z
Assignee: Josef Karasek
QA Contact: Anping Li
URL:
Whiteboard:
Depends On: 1517875
Blocks: 1541952
TreeView+ depends on / blocked
 
Reported: 2018-02-05 09:47 UTC by Josef Karasek
Modified: 2018-04-05 09:37 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Feature: Allow regular expressions in curator settings Reason: Customer request Result: A special tag can be used in curator settings to specify custom regular expressions.
Clone Of: 1517875
: 1541952 (view as bug list)
Environment:
Last Closed: 2018-04-05 09:37:08 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github https://github.com/openshift origin-aggregated-logging pull 911 None None None 2020-07-28 02:06:51 UTC
Red Hat Product Errata RHBA-2018:0636 None None None 2018-04-05 09:37:57 UTC

Comment 3 Anping Li 2018-03-02 08:23:00 UTC

@josef, PR still not merged to the latest logging-curator-v3.7.36-1

sh-4.2$ diff /opt/app-root/src/run_cron.py /tmp/run_cron.py    
103c103,107
< default_command = base_default_cmd + ' --older-than ' + str(default_value) + ' --time-unit ' + default_time_unit + ' --exclude .searchguard* --exclude .kibana*'
---
> default_command = base_default_cmd \
>         + ' --older-than ' + str(default_value) \
>         + ' --time-unit ' + default_time_unit \
>         + ' --exclude ' + shellquote('^' + re.escape('.searchguard.') + '.*$') \
>         + ' --exclude ' + shellquote('^' + re.escape('.kibana.') + '.*$')
116,117d119
<                     default_command = default_command + " --exclude " + shellquote(re.escape(project + '.') + '*')
< 
125a128,129
>                     default_command = default_command \
>                             + " --exclude " + shellquote('^' + re.escape(this_project + '.') + '.*$')
151c155
<                 lambda project:'^' + re.escape(project + '.'),
---
>                 lambda project:'^' + re.escape(project + '.') + '.*$',

Comment 5 Anping Li 2018-03-06 10:53:11 UTC
[root@ip-172-18-1-175 ~]# oc get configmap logging-curator -o yaml
apiVersion: v1
data:
  config.yaml: |
    .defaults:
      delete:
        days: 30
      runhour: 0
      runminute: 0

    .operations:
      delete:
        weeks: 8

    myapp:
      delete:
        weeks: 1

    .regex:
    - pattern: '^project\..+\-dev\..*$'
      delete:
        days: 15
    - pattern: '^project\..+\-test\..*$'
      delete:
        days: 30


# oc logs logging-curator-2-kxnkd
The project name must match this regex: [^[a-z0-9]([-a-z0-9]*[a-z0-9])?$] This does not match: [.regex]

Comment 6 Josef Karasek 2018-03-12 15:47:42 UTC
The previous build did not have the latest code, let's wait for another one

Comment 7 Anping Li 2018-03-20 04:52:02 UTC
Verified with openshift3/logging-curator/images/v3.7.39-1

Comment 11 errata-xmlrpc 2018-04-05 09:37:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0636


Note You need to log in before you can comment on or make changes to this bug.