HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/engines/__pycache__/fluent.cpython-310.pyc
o

�N�g	�@sddZddlZddlZz
ddlmZmZWneydZYnwe�e	�Z
dZdd�Zdd
d�Z
dS)
a�
An engine that reads messages from the salt event bus and pushes
them onto a fluent endpoint.

.. versionadded:: 3000

:Configuration:

All arguments are optional

    Example configuration of default settings

    .. code-block:: yaml

        engines:
          - fluent:
              host: localhost
              port: 24224
              app: engine

    Example fluentd configuration

    .. code-block:: none

        <source>
            @type forward
            port 24224
        </source>

        <match saltstack.**>
            @type file
            path /var/log/td-agent/saltstack
        </match>

:depends: fluent-logger
�N)�event�sender�fluentcCstdurtSdS)N)Fzfluent-logger not installed)r�__virtualname__�rr�G/opt/saltstack/salt/lib/python3.10/site-packages/salt/engines/fluent.py�__virtual__4s
���r�	localhost�^�enginecCs�d}tj|||d�t�d��d�rtjjjttddd�}n
tjjj	dttddd	�}t
�d
�|�	|��}|rAt�
||�q51sEwYdS)ao
    Listen to salt events and forward them to fluent

    args:
        host (str): Host running fluentd agent. Default is localhost
        port (int): Port of fluentd agent. Default is 24224
        app (str): Text sent as fluentd tag. Default is "engine". This text is appended
                   to "saltstack." to form a fluentd tag, ex: "saltstack.engine"
    �	saltstack)�host�port�idZ_master�sock_dirT)�listenZminion)�optsrrzFluent engine startedN)r�setupZ__opts__�get�endswith�salt�utilsrZget_master_eventZ	get_event�log�infoZget_event_block�Event)r
rZappZSENDER_NAMEZ	event_busZ
salt_eventrrr�start<s(

��
��r)r	r
r)�__doc__�loggingZsalt.utils.eventrrrr�ImportError�	getLogger�__name__rrrrrrrr�<module>s%�