Multiple .conf files logging data to the same measurement table?

Hi,

Currently I am setup with two .conf files in telegraf logging data independently to the same measurement table in influxdb. Is it possible for this to cause concurrency issues?

Both data collectors use the following block of code to trim “.0” from the incoming mac-addresses from the agents.

[[processors.strings]]
namepass = [“xxx-xxx-mem-use”]
order = 1

[[processors.strings.trim_suffix]]
tag = “index”
suffix = “.0”

There is additional code (which I cannot share), that then takes this mac-address and converts it to a valid format if it matches the pattern ‘^(\d+).(\d+).(\d+).(\d+).(\d+).(\d+)$’;

For example: “0.24.73.2.68.5” ==> “00:18:49:2:44:05”

For the most part it works except for the case with the mac-address “0.24.73.2.67.0.0”.
The expected output in the table is expected to be “00:18:49:2:43:00” instead I am seeing “0.24.73.2.67”.

It is as if the “.0” suffix trimming is happening twice, thus there is no pattern match and the number doesn’t get converted.

Could this be due to some kind of concurrency issue in telegraf, where the trim operation is happening twice?

Also the data is generated via SNMP, which returns an index “.0” or “.1” appended at the end of the values. Thus the need to trim the index off at the end.

Thoughts?

Currently I am setup with two .conf files in telegraf logging data independently to the same measurement table in influxdb. Is it possible for this to cause concurrency issues?

It is pretty common to have multiple files with many inputs going to one or more outputs. I don’t believe that is the issue here.

Could this be due to some kind of concurrency issue in telegraf, where the trim operation is happening twice?

Do you have any aggregators in your configuration? Processors are run a second time after any aggregator.

Hi jpowers,

Thanks for responding. At present I don’t have any aggregators in either of the .conf files. The general structure of both files is as follows.

[[inputs.snmp]]
name = “xxx-xxx-mem-use”
interval = " ms"
tagexclude = [“tag_1”, “tag_2”]

Agent addresses to retrieve values from.

agents = [“agent_#”]

SNMP version

version = 2

SNMP community string.

community = “string_value”

Number of retries to attempt.

retries = 0

SNMP table definition.

[[inputs.snmp.table]]
name = “xxx-xxx-mem-use”
index_as_tag = xxx

[[inputs.snmp.table.field]]
  name = "xxxx"
  oid = "DOCS-XXXX-MIB::xxxxXXXXXxxxxx"
  is_tag = xxx

[[inputs.snmp.table.field]]
  name = "xxx-mem-use"
  oid = "DOCS-XXXX-MIB::xxxxXXXXXxxxxx"

Define tag matches required for this input to be accepted.

[inputs.snmp.tagpass]
stor-desc = [“XXXX”]

[[processors.strings]]
namepass = [“xxx-xxx-mem-use”]
order = 1

[[processors.strings.trim_suffix]]
tag = “index”
suffix = “.0”

[[processors.rename]]
namepass = [“xxx-xxx-mem-use”]
order = 2

[[processors.rename.replace]]
tag = “index”
dest = “xXx-mac-address”

[[processors.rename.replace]]
tag = “xxx_xxxx”
dest = “xxxxxx”

Transforms tag and field values with regex pattern

[[processors.CUSTOM_PLUGIN]]
namepass = [“xxx-xxx-mem-use”]
order = 3

Tag and field conversions defined in separate sub-tables

[[processors.CUSTOM_PLUGIN.tags]]
## Tag to change
<Custom code to perform mac-address conversion, dec to hex>

Basically the overall flow is;

  1. Create a table called “xxx-xxx-mem-use”.
  2. Use SNMP protocol to query the data of interest from the device.
  3. Populate the data in the table.
  4. Use processors.strings.trim_suffix to remove the extra “.0” at the end of the mac address data.
  5. Use custom proprietary plugin to convert the mac address from decimal format to hex.

The problem occurs at step 4, with incoming mac-address “0.24.73.2.67.0.0”. The trim seems to be happening twice.

Thanks in advance for your inputs.

Based on your flow, it sounds like everything is working up to step 5? Can you confirm that if you remove this proprietary plugin, does it work as expected?