%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/engines/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/engines/http_logstash.pyc

�
���^c@@s{dZddlmZmZmZddlZddlZddlZddl	Zidd6Z
d�Zddd�Z
dS(u�
HTTP Logstash engine
==========================

An engine that reads messages from the salt event bus and pushes
them onto a logstash endpoint via HTTP requests.

.. versionchanged:: 2018.3.0

.. note::
    By default, this engine take everything from the Salt bus and exports into
    Logstash.
    For a better selection of the events that you want to publish, you can use
    the ``tags`` and ``funs`` options.

:configuration: Example configuration

    .. code-block:: yaml

        engines:
          - http_logstash:
              url: http://blabla.com/salt-stuff
              tags:
                  - salt/job/*/new
                  - salt/job/*/ret/*
              funs:
                  - probes.results
                  - bgp.config
i(tabsolute_importtprint_functiontunicode_literalsNuapplication/jsonuContent-Typec
C@sItjjj|ddtdtjjj|�dtdtdt�}|S(u5
    Issues HTTP queries to the logstash server.
    uPOSTtheader_dicttdatatdecodetstatustopts(	tsalttutilsthttptqueryt_HEADERStjsontdumpstTruet__opts__(turlRtresult((s>/usr/lib/python2.7/site-packages/salt/engines/http_logstash.pyt	_logstash9s	c	C@s,tjd�jd�r!d}nd}tjjj|dtddtdd	t�}x�tr'|jd
t�}|rYt}|r�t|t	�r�t
}x-|D]%}tj|d|�r�t}q�q�W|}n|rd|d
kr|d
d|krt
}qn|r$t||d
�q$qYqYWdS(u�
    Listen to salt events and forward them to logstash.

    url
        The Logstash endpoint.

    funs: ``None``
        A list of functions to be compared against, looking into the ``fun``
        field from the event data. This option helps to select the events
        generated by one or more functions.
        If an event does not have the ``fun`` field in the data section, it
        will be published. For a better selection, consider using the ``tags``
        option.
        By default, this option accepts any event to be submitted to Logstash.

    tags: ``None``
        A list of pattern to compare the event tag against.
        By default, this option accepts any event to be submitted to Logstash.
    uidu_masterumasteruminiontsock_dirusock_dirt	transportu	transportRtfullutagufunudataN(
RtgettendswithRR	teventt	get_eventRt
isinstancetlisttFalsetfnmatchR(	Rtfunsttagstinstancet	event_busRtpublishtfound_matchttag((s>/usr/lib/python2.7/site-packages/salt/engines/http_logstash.pytstartMs,	

		

	(t__doc__t
__future__RRRRtsalt.utils.httpRtsalt.utils.eventtsalt.utils.jsonRRtNoneR&(((s>/usr/lib/python2.7/site-packages/salt/engines/http_logstash.pyt<module>s
	

Zerion Mini Shell 1.0