diff --git a/perfsonar-logstash/perfsonar-logstash/scripts/update_logstash_pipeline_yml.py b/perfsonar-logstash/perfsonar-logstash/scripts/update_logstash_pipeline_yml.py index 2008572..e1b61bd 100644 --- a/perfsonar-logstash/perfsonar-logstash/scripts/update_logstash_pipeline_yml.py +++ b/perfsonar-logstash/perfsonar-logstash/scripts/update_logstash_pipeline_yml.py @@ -11,16 +11,24 @@ pipeline_exists = False #look for pscheduler pipeline +write_file = False for pipeline in pipelines_yml: if pipeline is not None and pipeline.get("pipeline.id", None) == "pscheduler": - pipeline_exists = True - break + if pipeline.get("pipeline.ecs_compatibility", "") != "disabled": + pipeline["pipeline.ecs_compatibility"] = "disabled" + write_file = True + pipeline_exists = True + break #if not exists, then add it and output to file if not pipeline_exists: + write_file = True pipelines_yml.append({ "pipeline.id": "pscheduler", - "path.config": "/usr/lib/perfsonar/logstash/pipeline/*.conf" + "path.config": "/usr/lib/perfsonar/logstash/pipeline/*.conf", + "pipeline.ecs_compatibility": "disabled" }) + +if write_file: with open('/etc/logstash/pipelines.yml', 'w') as file: file.write(yaml.dump(pipelines_yml, default_flow_style=False))