Exemplo n.º 1
0
 def __init__(self,
              host,
              port,
              url,
              secure=False,
              credentials=None,
              context=None,
              tags=None,
              message_type='logstash',
              fqdn=False,
              version=0,
              level='NOTSET'):
     super(HTTPLogstashHandler, self).__init__(level)
     if not secure and context is not None:
         raise ValueError(
             "context parameter only makes sense with secure=True")
     if version == 1:
         self.formatter = formatter.LogstashFormatterVersion1(
             message_type, tags, fqdn)
     else:
         self.formatter = formatter.LogstashFormatterVersion0(
             message_type, tags, fqdn)
     self.tags = tags
     self.port = port
     self.host = host
     self.url = url
     self.method = 'POST'
     self.secure = secure
     self.credentials = credentials
     self.context = context
Exemplo n.º 2
0
    def __init__(self,
                 host,
                 port=5959,
                 message_type='logstash',
                 tags=None,
                 fqdn=False,
                 version=0,
                 ssl=True,
                 ssl_verify=True,
                 keyfile=None,
                 certfile=None,
                 ca_certs=None,
                 log_attrs=None,
                 extra_fields=None):
        super(TCPLogstashHandler, self).__init__(host, port)

        self.ssl = ssl
        self.ssl_verify = ssl_verify
        self.keyfile = keyfile
        self.certfile = certfile
        self.ca_certs = ca_certs

        if version == 1:
            self.formatter = formatter.LogstashFormatterVersion1(
                message_type, tags, fqdn, log_attrs, extra_fields)
        else:
            self.formatter = formatter.LogstashFormatterVersion0(
                message_type, tags, fqdn, log_attrs, extra_fields)
Exemplo n.º 3
0
    def __init__(self, host, port=5959, message_type='logstash', tags=None,
                 fqdn=False, version=0, *args, **kwargs):
        super(TCPLogstashHandler, self).__init__(host, port, *args, **kwargs)

        if version == 1:
            self.formatter = formatter.LogstashFormatterVersion1(
                message_type, tags, fqdn)
        else:
            self.formatter = formatter.LogstashFormatterVersion0(
                message_type, tags, fqdn)
Exemplo n.º 4
0
 def __init__(self,
              host,
              port=5959,
              message_type='logstash',
              fqdn=False,
              version=0):
     super(TCPLogstashHandler, self).__init__(host, port)
     if version == 1:
         self.formatter = formatter.LogstashFormatterVersion1(
             message_type, [], fqdn)
     else:
         self.formatter = formatter.LogstashFormatterVersion0(
             message_type, [], fqdn)