Don't send to Logstash if it's disabled

This commit is contained in:
Mark Veidemanis 2022-07-21 13:40:40 +01:00
parent 4b33559e65
commit b149886128
1 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,7 @@ from core.logstash import sendLogstashNotification
from core.relay import sendRelayNotification from core.relay import sendRelayNotification
from modules import userinfo from modules import userinfo
from utils.dedup import dedup from utils.dedup import dedup
import main
order = [ order = [
"type", "type",
@ -74,5 +75,6 @@ def event(numName, c): # yes I'm using a short variable because otherwise it go
del c["muser"] del c["muser"]
sortedKeys = {k: c[k] for k in order if k in c} # Sort dict keys according to order sortedKeys = {k: c[k] for k in order if k in c} # Sort dict keys according to order
sortedKeys["src"] = "irc" sortedKeys["src"] = "irc"
if main.config["Logstash"]["Enabled"]:
sendLogstashNotification(sortedKeys) sendLogstashNotification(sortedKeys)
sendRelayNotification(sortedKeys) sendRelayNotification(sortedKeys)