From d792e4d12e85e9de7d391273eafcab954fded2d8 Mon Sep 17 00:00:00 2001 From: Andy Lake Date: Thu, 26 Oct 2023 16:33:52 -0400 Subject: [PATCH] Small fix for logstash 8 pipeline --- .../scripts/update_logstash_pipeline_yml.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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))