diff options
author | Rasmus Luha <rasmus.luha@ut.ee> | 2025-04-26 01:10:52 +0300 |
---|---|---|
committer | Rasmus Luha <rasmus.luha@ut.ee> | 2025-04-26 01:10:52 +0300 |
commit | 6b3c096f6efea8855772c7faffa90f71861290bd (patch) | |
tree | b8b820dc282578851892c8e9fab0b937dcb6cb78 /modules/telegraf/testing.py | |
parent | 0a16e0e3e586456cf2e86dbdad4b66787b036a5d (diff) |
telegraf initial pluggin modifiying implemented
Diffstat (limited to 'modules/telegraf/testing.py')
-rw-r--r-- | modules/telegraf/testing.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/telegraf/testing.py b/modules/telegraf/testing.py new file mode 100644 index 0000000..d049bbf --- /dev/null +++ b/modules/telegraf/testing.py @@ -0,0 +1,17 @@ +import toml + +def modify_input(template, new_pipeline_path, key, value): + data = toml.load(template) + pluggin = data["inputs"]["http"][0] + + if key in pluggin: + + print(f"Before: {key} = {http_input[key]}") + http_input[key] = value + print(f"After: {key} = {http_input[key]}") + + + with open(new_pipeline_path, "w") as f: + toml.dump(data, f) + +modify_input("templates/basic_ETL.toml", "test_pipers.toml, "urls", ["stillTesting"]) |