mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-05-23 20:35:23 +00:00
Fix CLI argument logic
This commit is contained in:
+5
-9
@@ -164,21 +164,17 @@ def _main():
|
||||
if args.elasticsearch_host:
|
||||
elastic.set_hosts(args.elasticsearch_host)
|
||||
elastic.create_indexes()
|
||||
if args.hec:
|
||||
if args.hec_token is None or args.hec_index is None:
|
||||
logger.error("HEC token and HEC index are required when "
|
||||
"using HEC URL")
|
||||
exit(1)
|
||||
hec_client = splunk.HECClient(args.hec, args.hec_token,
|
||||
index=args.hec_index)
|
||||
except ElasticsearchException as error:
|
||||
logger.error("Elasticsearch Error: {0}".format(error.__str__()))
|
||||
exit(1)
|
||||
|
||||
if args.hec:
|
||||
if args.hec_key is None:
|
||||
logger.error("HEC URL provided without HEC key")
|
||||
if args.hec_token is None or args.hec_index is None:
|
||||
logger.error("HEC token and HEC index are required when "
|
||||
"using HEC URL")
|
||||
exit(1)
|
||||
hec_client = splunk.HECClient(args.hec, args.hec_token,
|
||||
args.hec_index)
|
||||
|
||||
file_paths = []
|
||||
for file_path in args.file_path:
|
||||
|
||||
Reference in New Issue
Block a user