-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[inputs.modbus] Group coil/discrete/holding/input metric together #16031
Comments
Any reason you can't use the merge aggregator? https://github.com/influxdata/telegraf/blob/master/plugins/aggregators/merge/README.md |
Aggregator need an extra delay. If group in inputs, it will be better. And other inputs like s7comm, provide grouped metric |
@ffutop please use the |
Hi, @srebhan . I tried metric configuration style, but there is no different. Configuration[[inputs.modbus]]
name_override = "modbus"
name = "modbus"
timeout = "1s"
controller = "tcp://172.16.2.31:502"
configuration_type = "metric"
[[inputs.modbus.metric]]
slave_id = 1
byte_order = "ABCD"
fields = [
{register = "holding", address = 101, name = '4x0102:INT', type = 'INT16'},
{register = "holding", address = 102, name = '4x0103:INT', type = 'INT16'},
{register = "input", address = 134, name = '3x0135:INT', type = 'INT16'},
]
[inputs.modbus.metric.tags]
type = ""
[[outputs.file]]
files = ["stdout"]
data_format = "influx" Actual behavior
ExtraI'm not sure if I missed something. I've read the source code, and it force split four types. |
@srebhan Thx, it works. |
@ffutop please keep the issue open, it will be automatically closed once the PR is merged. This way other users can know when master contains the fix... |
Use Case
I know modbus plugin will provide predefined tags: slave_id, type
but even I force tag
type = ""
, the result still split in two records.Expected behavior
Actual behavior
Additional info
I read the source, the code force split in four types.
Should we modify it, and group metric together if user-defined tag set
type = ""
or set sametype
?The text was updated successfully, but these errors were encountered: