Is there way to have two telegraf.conf (different fields values ) with same input plugins

lets say i have input plugin A and wanted to have telegrafA.conf and telegrafB.conf

input plugin A for telegrafA.conf
field1 = value
field2=value
same inplugin A for telegrafB.conf
field1 = value
field2 = value
field3 = value
field4= value

Hi,

I’m not entirely sure I follow what you are asking, but let me know if you think I am close:

If you want to split up your configuration across two files you absolutely can. For example if I have two file inputs I could do:

main.conf

[[inputs.file]]
   files = ["/tmp/metrics.out"]
   data_format = "influx"

[[outputs.file]]

other.conf

[[inputs.file]]
   files = ["/tmp/otherfile.out"]
   data_format = "influx_upstream"

and then to use both files you can run:

telegraf --config main.conf --config other.conf

Or if you have both in a folder called configs you could run:

telegraf --config-directory configs
1 Like

yes you are close to my topic. how do we generate different configuration across two file for single input plugin.
do we have any way or we need to update manually?

A plugin, in this case a TOML table must be contained in a single file. Trying to split it across files would be invalid TOML

@Nasreen_Begum can you provide an example of what your ideal configurations look like?

@srebhan Please find below description

lets say i have input plugin A and wanted to have telegrafA.conf and telegrafB.conf

input plugin A for telegrafA.conf
[[inputs.A]]
field1 = value
field2=value
same inplugin A for telegrafB.conf
[[inputs.A]]
field1 = value
field2 = value
field3 = value
field4= value
[[inputs.x]]
fieldx = value
fieldy = value

@Nasreen_Begum if both files are given to Telegraf, this would create two instances of type inputs.A with the different settings. Is this what you want?