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