Skip to content

Commit

Permalink
Small fix for logstash 8 pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
arlake228 committed Oct 26, 2023
1 parent 5bc5173 commit d792e4d
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit d792e4d

Please sign in to comment.