Skip to content

process

Process Manager for Logstash process

To import...

from dynamite_nsm.services.logstash import process as logstash_process

CallLogstashProcessError

__init__(self, message) special

Thrown when logstash process encounters an error state

Parameters:

Name Type Description Default
message

A more specific error message

required

Returns:

Type Description

None

Source code in dynamite_nsm/services/logstash/process.py
def __init__(self, message):
    """Thrown when logstash process encounters an error state
    Args:
        message: A more specific error message
    Returns:
        None
    """
    msg = "An error occurred while calling logstash process: {}".format(message)
    super(CallLogstashProcessError, self).__init__(msg)

ProcessManager

__init__(self, stdout=True, verbose=False, pretty_print_status=False) special

Manage Logstash Process

Parameters:

Name Type Description Default
stdout Optional[bool]

Print output to console

True
verbose Optional[bool]

Include detailed debug messages

False
pretty_print_status Optional[bool]

If enabled, status will be printed in a tabulated style

False

Returns:

Type Description

None

Source code in dynamite_nsm/services/logstash/process.py
def __init__(self, stdout: Optional[bool] = True, verbose: Optional[bool] = False,
             pretty_print_status: Optional[bool] = False):
    """Manage Logstash Process
    Args:
        stdout: Print output to console
        verbose: Include detailed debug messages
        pretty_print_status: If enabled, status will be printed in a tabulated style
    Returns:
        None
    """
    environ = utilities.get_environment_file_dict()
    process.BaseProcessManager.__init__(self, 'logstash.service', 'logstash.process', log_path=environ.get('LS_LOGS'),
                                        stdout=stdout, verbose=verbose, pretty_print_status=pretty_print_status)

    if not logstash_profile.ProcessProfiler().is_installed():
        self.logger.error("LogStash is not installed. Install it with 'dynamite logstash install -h'")
        raise CallLogstashProcessError("LogStash is not installed.")