You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hbyd_ueba/cron/ueba_cron_data_insert.py

31 lines
833 B

4 months ago
# coding=utf-8
"""
4 months ago
@Author: tangwy
4 months ago
@FileName: user_cron.py
4 months ago
@DateTime: 2024/7/15
@Description: ueba数据清洗定时任务 将文件数据写入pg
4 months ago
"""
from __future__ import unicode_literals
import traceback
4 months ago
from uebaMetricsAnalysis.utils.ext_logging import logger_cron
from uebaMetricsAnalysis.utils.file_to_pg import entry
4 months ago
JOB_STATUS ={
"RUNNING":1,
"FINISH":2,
"ERROR":3
}
4 months ago
class DataInsertCron:
4 months ago
#每5分钟执行一次
def processing(self):
try:
4 months ago
logger_cron.info("INSERT:开始执行")
entry()
logger_cron.info("INSERT:"+"执行完成")
4 months ago
except Exception ,e:
4 months ago
err_info=traceback.format_exc()
logger_cron.error("INSERT:"+"执行失败,"+err_info)
4 months ago
raise
4 months ago
if __name__ == '__main__':
4 months ago
DataInsertCron().processing()