Implement indexing into Apache Druid #1

Closed
m wants to merge 263 commits from druid into master
1 changed files with 19 additions and 0 deletions
Showing only changes of commit 0854c6d60d - Show all commits

19
core/logstash.py Normal file
View File

@ -0,0 +1,19 @@
import logstash
import logging
from json import dumps, loads
import main
from utils.logging.log import *
logger = None
def init_logstash():
global logger
logger = logging.getLogger('ingest')
logger.setLevel(logging.INFO)
logger.addHandler(logstash.TCPLogstashHandler(main.config["Logstash"]["Host"], int(main.config["Logstash"]["Port"]), version=1))
def sendLogstashNotification(text):
if not logger == None:
logger.info(dumps(text))
return True
return False