Input timestamp precision

I’m currently collecting data using telegraf and the input SNMP plugin which is working great but I need a higher level of precision.

I tried to set the following in my telegraf.conf file:

## By default or when set to "0s", precision will be set to the same
## timestamp order as the collection interval, with the maximum being 1s.
##   ie, when interval = "10s", precision will be "1s"
##       when interval = "250ms", precision will be "1ms"
## Precision will NOT be used for service inputs. It is up to each individual
## service input to set the timestamp at the appropriate precision.
## Valid time units are "ns", "us" (or "µs"), "ms", "s".
precision = "ns" //tried ms too

My SNMP input plugin looks like this:


# List of hosts to poll
agents = [

interval = "5s" //tried setting this to 5000ms as well

## Timeout for each request.
timeout = "1000s"

## SNMP version; can be 1, 2, or 3.
version = 2

## SNMP community string.
community = "public"

## Number of retries to attempt.
retries = 5


name = "interface"
index_as_tag = true

oid = ""
name = "SNMP_IF-MIB::ifHCInOctets"

oid = ""
name = "SNMP_IF-MIB::ifHCOutOctets"

No matter what I do i can’t seem to get any precision that’s higher than second. How can I get a ms or ns precision on the timestamps?

Sample output:

    "fields": {
        "SNMP_IF-MIB::ifHCInOctets": 1058824135606,
        "SNMP_IF-MIB::ifHCOutOctets": 225501345550
    "name": "interface",
    "tags": {
        "collectionId": "1",
        "device": "east-ece1",
        "oidIndex": "2001",
        "projectId": "1",
        "sourceId": "10",
        "type": "snmp"
    "timestamp": 1603386273

Any help would be appreciated.

NOTE: there are a few more transformations, but nothing to do with date. For reference adding the config here as well:


tag = "agent_host"
dest = "device"

tag = "host"
dest = "collector"

tag = "index"
dest = "oidIndex"