title: Python - How to write log to an already existing Kibana?
body: <p>Well I was asked to write <code>log</code> to an existing Kibana.</p>
  <p>I was given a <code>host</code> and a <code>port</code>, I suppose that is the <code>host</code> and <code>port</code> of log stash.</p>
  <p>I was told to search about how to send <code>log</code> to that host. That's all.</p>
  <p>I have been researching but can not do anything.</p>
  <p>My code so far:</p>
  <pre><code>import logging
  from logging import StreamHandler
  import logstash
  import sys
  
  host = '1**.**.**.***'   #this is the host I was given.
  
  test_logger = logging.getLogger('venus-local')
  test_logger.setLevel(logging.INFO)
  test_logger.addHandler(logstash.TCPLogstashHandler(host, 5000, version=1))
  test_logger.addHandler(StreamHandler())
  
  try:
      test_logger.error('venus-local: test logstash error message.')
      test_logger.info('venus-local: test logstash info message.')
      test_logger.warning('venus-local: test logstash warning message.')
  
      # add extra field to logstash message
      extra = {
          'test_string': 'python version: ' + repr(sys.version_info),
          'test_boolean': True,
          'test_dict': {'a': 1, 'b': 'c'},
          'test_float': 1.23,
          'test_integer': 123,
          'test_list': [1, 2, '3'],
      }
      test_logger.info('venus-local: test extra fields', extra=extra)
  except:
      print(&quot;Error&quot;)
  </code></pre>
  <p>When I run the above code, there is no error, it works (with no exception). But there is no change on the Kibana.</p>