mirror of
https://github.com/wolfswolke/DeathGarden_API_Rebirth.git
synced 2026-07-19 01:13:31 -05:00
Removed Elasticsearch_handler.py
This commit is contained in:
parent
3033f1dcab
commit
3df7b29dd5
|
|
@ -1,28 +0,0 @@
|
|||
from datetime import datetime, date
|
||||
from elasticsearch import Elasticsearch
|
||||
import json
|
||||
|
||||
|
||||
def es_upload(server, index, log_message):
|
||||
if type(log_message) is not dict:
|
||||
log_message = {"steam_key": log_message}
|
||||
log_message["timestamp"] = datetime.utcnow().isoformat()
|
||||
es = Elasticsearch(server)
|
||||
data = json.dumps(log_message)
|
||||
response = es.index(index=index, body=data, headers={'Content-Type': 'application/json;charset=UTF-8'})
|
||||
document_id = response['_id']
|
||||
print("Uploaded dictionary with ID:", document_id)
|
||||
|
||||
|
||||
def dev_es_upload(server, index, log_message):
|
||||
if index == "client_event":
|
||||
playerUniqueId = log_message["playerUniqueId"]
|
||||
clientEvent = log_message["clientEvent"]
|
||||
eventType = log_message["eventType"]
|
||||
timestamp = datetime.utcnow().isoformat()
|
||||
upload_string = "Message: {}. Sender: {}.".format(clientEvent, playerUniqueId)
|
||||
upload_message = {"msg_type": "error", "timestamp": timestamp, "message": upload_string, "type": "string"}
|
||||
es = Elasticsearch(server)
|
||||
response = es.index(index="dev_client_event", body=upload_message)
|
||||
document_id = response['_id']
|
||||
print("Uploaded dictionary with ID:", document_id)
|
||||
Loading…
Reference in New Issue
Block a user