Patch: Fix indentation and logging errors
This commit is contained in:
@@ -4,12 +4,9 @@ import logging
|
|||||||
import iris_api
|
import iris_api
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
logging.basicConfig(filename='/var/ossec/logs/integrations.log', level=logging.INFO,
|
|
||||||
format='%(asctime)s %(levelname)s: %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if len(sys.argv) < 4:
|
if len(sys.argv) < 4:
|
||||||
logging.error("Insufficient arguments provided. Exiting.")
|
print("Not enough arguments!")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
alert_file = sys.argv[1]
|
alert_file = sys.argv[1]
|
||||||
@@ -20,7 +17,6 @@ def main():
|
|||||||
with open(alert_file) as f:
|
with open(alert_file) as f:
|
||||||
alert_json = json.load(f)
|
alert_json = json.load(f)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Failed to read alert file: {e}")
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
client = iris_api.IrisClient(hook_url, api_key)
|
client = iris_api.IrisClient(hook_url, api_key)
|
||||||
|
|||||||
Reference in New Issue
Block a user