Curator_CLI not logging arguments

We are trying to debug a script that uses curator_cli. We thought that it wasn't working because in the log files we were seeing this:

2019-02-20 11:17:53,690 INFO      DRY-RUN MODE.  No changes will be made.
2019-02-20 11:17:53,690 INFO      (CLOSED) indices may be shown that may not be acted on by action "delete_indices".
2019-02-20 11:17:53,690 INFO      DRY-RUN: delete_indices: metricbeat-6.2.3-2019.02.05 with arguments: {}
2019-02-20 11:17:53,690 INFO      DRY-RUN: delete_indices: metricbeat-6.2.3-2019.02.06 with arguments: {}
2019-02-20 11:17:53,690 INFO      DRY-RUN: delete_indices: metricbeat-6.2.3-2019.02.07 with arguments: {}
2019-02-20 11:17:53,690 INFO      DRY-RUN: delete_indices: metricbeat-6.2.3-2019.02.08 with arguments: {}
2019-02-20 11:17:53,691 INFO      "delete_indices" action completed.

We suspected that we are passing valid JSON arguments but they were just not showing up in the logs. If we switch to DEBUG mode we see the following, which seems to be showing that values are being accepted and used:

2019-02-20 11:17:49,457 DEBUG     curator.cli_singletons.cli_action.delete_indices          check_options:96   Validating provided options: {'allow_ilm_indices': False}
2019-02-20 11:17:49,458 DEBUG     curator.validators.SchemaCheck               __init__:26   Schema: {'allow_ilm_indices': Any(<class 'bool'>, All(Any(<class 'str'>, msg=None), <function Boolean at 0x7fd8c99727b8>, msg=None), msg=None), 'continue_if_exception': Any(<class 'bool'>, All(Any(<class 'str'>, msg=None), <function Boolean at 0x7fd8c9972950>, msg=None), msg=None), 'disable_action': Any(<class 'bool'>, All(Any(<class 'str'>, msg=None), <function Boolean at 0x7fd8c9972ae8>, msg=None), msg=None), 'ignore_empty_list': Any(<class 'bool'>, All(Any(<class 'str'>, msg=None), <function Boolean at 0x7fd8c9972c80>, msg=None), msg=None), 'timeout_override': Any(Coerce(int, msg=None), None, msg=None)}
2019-02-20 11:17:49,458 DEBUG     curator.validators.SchemaCheck               __init__:27   "options" config: {'allow_ilm_indices': False}
2019-02-20 11:17:49,458 DEBUG     curator.cli_singletons.cli_action.delete_indices          check_filters:117  Validating provided filters: [{'filtertype': 'age', 'source': 'creation_date', 'direction': 'older', 'unit': 'days', 'unit_count': 30}, {'filtertype': 'pattern', 'kind': 'prefix', 'value': 'syslog-'}]
2019-02-20 11:17:49,458 DEBUG     curator.validators.SchemaCheck               __init__:26   Schema: <function Filters.<locals>.f at 0x7fd8c999a7b8>
2019-02-20 11:17:49,458 DEBUG     curator.validators.SchemaCheck               __init__:27   "filters" config: [{'filtertype': 'age', 'source': 'creation_date', 'direction': 'older', 'unit': 'days', 'unit_count': 30}, {'filtertype': 'pattern', 'kind': 'prefix', 'value': 'syslog-'}]
<snip>
2019-02-20 11:17:49,459 DEBUG     curator.validators.SchemaCheck               __init__:27   "filter" config: {'filtertype': 'age', 'source': 'creation_date', 'direction': 'older', 'unit': 'days', 'unit_count': 30}
2019-02-20 11:17:49,459 DEBUG     curator.validators.filters                      f:48   Filter #0: {'filtertype': 'age', 'source': 'creation_date', 'direction': 'older', 'unit': 'days', 'unit_count': 30, 'stats_result': 'min_value', 'timestring': None, 'exclude': False, 'epoch': None}
2019-02-20 11:17:49,459 DEBUG     curator.validators.SchemaCheck               __init__:26   Schema: {'filtertype': Any(In(['age', 'alias', 'allocated', 'closed', 'count', 'forcemerged', 'ilm', 'kibana', 'none', 'opened', 'pattern', 'period', 'space', 'state']), msg="filtertype must be one of ['age', 'alias', 'allocated', 'closed', 'count', 'forcemerged', 'ilm', 'kibana', 'none', 'opened', 'pattern', 'period', 'space', 'state']"), 'kind': Any('prefix', 'suffix', 'timestring', 'regex', msg=None), 'value': Any(<class 'str'>, msg=None), 'exclude': Any(<class 'bool'>, All(Any(<class 'str'>, msg=None), <function Boolean at 0x7fd8c9998f28>, msg=None), msg=None)}
2019-02-20 11:17:49,459 DEBUG     curator.validators.SchemaCheck               __init__:27   "filter" config: {'filtertype': 'pattern', 'kind': 'prefix', 'value': 'syslog-'}
2019-02-20 11:17:49,459 DEBUG     curator.validators.filters                      f:48   Filter #1: {'filtertype': 'pattern', 'kind': 'prefix', 'value': 'syslog-', 'exclude': False}
2019-02-20 11:17:49,459 DEBUG              curator.utils             get_client:803  kwargs = {'hosts': ['10.10.217.86'], 'port': 9200, 'use_ssl': False, 'ssl_no_validate': False, 'timeout': 30, 'master_only': False, 'url_prefix': '', 'aws_sign_request': False, 'http_auth': None, 'client_cert': None, 'aws_token': None, 'certificate': None, 'aws_key': None, 'aws_secret_key': None, 'client_key': None}

Is this a bug in the application or are we not understanding what should show up in the logs?

It really would be helpful to know at least what filters are being used in the logs without having to go to DEBUG level. I suppose we can have the script write this information to the log file, but this just wasn't expected behavior.

Yes. At present, you need to be in DEBUG mode to see that much configuration detail. If you think this should be shown in INFO, please feel free to open a feature request at https://github.com/elastic/curator

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.