cassandra_fullquerylog -- Manages the full query log feature.

Synopsis

Manages the full query log feature.

Enable, disable or reset feature.

Manage configuration.

Supported from Cassandra 4.0 onwards.

When state is disabled the value of the other configuration options are ignored.

The module always returns changed when state is reset.

Requirements

The below requirements are needed on the host that executes this module.

Parameters

state (optional, str, enabled)
The required status
log_dir (optional, str, None)
The log directory.
archive_command (optional, str, None)

Command that will handle archiving rolled full query log files.

Format is "/path/to/script.sh %path" where %path will be replaced with the file to archive.

roll_cycle (optional, str, HOURLY)
How often to roll the log file.
blocking (optional, bool, True)
If the queue is full whether to block producers or drop samples.
max_log_size (optional, int, 17179869184)
How many bytes of log data to store before dropping segments.
max_queue_weight (optional, int, 268435456)
Maximum number of bytes of query data to queue to disk before blocking or dropping samples.
max_archive_retries (optional, int, 10)
Max number of archive retries.
debug (optional, bool, False)
Enable extra debug output.
host (optional, str, 127.0.0.1)
The hostname.
port (optional, int, 7199)
The Cassandra TCP port.
password (optional, str, None)
The password to authenticate with.
password_file (optional, str, None)
Path to a file containing the password.
username (optional, str, None)
The username to authenticate with.
nodetool_path (optional, str, None)
The path to nodetool.
nodetool_flags (optional, str, -Dcom.sun.jndi.rmiURLParsing=legacy)
Flags to pass to nodetool.

Examples

- name: Enable the full query log
  community.cassandra.cassandra_fullquerylog:
    state: enabled
    log_dir: /var/log/cassandra_log_archive

- name: Disable the full query log
  community.cassandra.cassandra_fullquerylog:
    state: disabled

- name: Enable the full query log and configure daily rollover & custom archiving script
  community.cassandra.cassandra_fullquerylog:
    state: enabled
    log_dir: /var/log/cassandra_log_archive
    roll_cyle: DAILY
    archive_command: "/path/to/script.sh %path"

Return Values

msg (always, str, )
A short description of what the module did.
fullquerylog_config (success, dict, { 'max_queue_weight': 268435456, 'max_log_size': 17179869184, 'enabled': True, 'roll_cycle': 'HOURLY',
'archive_command': None, 'log_dir': None, 'max_archive_retries': 10, 'block': True}
)
The config of the full query log feature.

Status

Authors

  • Rhys Campbell (@rhysmeister)