title: Telegraf [[inputs.snmp.field]] converting string to int?
body: <p>I'm trying to create a new UPS.conf file for telegraf to collect data from a batch of ups units via SNMP.  Inputs such as hostname and upsType when queried via SNMPGet the OID's return a String, but when run using Telegraf I get only integer results. </p>
  
  <p><strong>My UPS.conf File</strong></p>
  
  <pre><code> [[inputs.snmp]]
        agents = [ "192.168.15.60", "192.168.15.64" , "192.168.15.65","192.168.15.66","192.168.15.67" ]
         ## Timeout for each SNMP query.
         timeout = "10s"
         ## Number of retries to attempt within timeout.
         retries = 3
         ## SNMP version, values can be 1, 2, or 3
         version = 3
  
         ## SNMP community string.
         community = "heabc"
      #
      #   ## The GETBULK max-repetitions parameter
      #   max_repetitions = 10
      #
      #   ## SNMPv3 auth parameters
          sec_name = "grafana"
          auth_protocol = "SHA"      # Values: "MD5", "SHA", ""
          auth_password = "redacted"
          sec_level = "authPriv"   # Values: "noAuthNoPriv", "authNoPriv", "authPriv"
      #   #context_name = ""
          priv_protocol = "AES"         # Values: "DES", "AES", ""
          priv_password = "redacted"
      #
      #   ## measurement name
  
       [[inputs.snmp.field]]
          name = "hostname"
          oid = "iso.1.3.6.1.2.1.1.6.0"
          conversion = ""
          is_tag = true
       [[inputs.snmp.field]]
          name = "upsType"
          oid = "iso.1.3.6.1.4.1.318.1.1.1.1.1.1.0"
          is_tag = true
          conversion = ""
  
       [[inputs.snmp.field]]
          name = "batteryCapacityPercent"
          oid = "iso.1.3.6.1.4.1.318.1.1.1.2.2.1.0"
  
       [[inputs.snmp.field]]
          name = "batteryTemp"
          oid = "iso.1.3.6.1.4.1.318.1.1.1.2.2.2.0"
       [[inputs.snmp.field]]
          name = "batteryRuntimeRemain"
          oid = "iso.1.3.6.1.4.1.318.1.1.1.2.2.3.0"
       [[inputs.snmp.field]]
          name = "batteryReplace"
          oid = "iso.1.3.6.1.4.1.318.1.1.1.2.2.4.0"
       [[inputs.snmp.field]]
          name = "inputVoltage"
          oid = "iso.1.3.6.1.4.1.318.1.1.1.3.2.1.0"
       [[inputs.snmp.field]]
          name = "inputFreq"
          oid = "iso.1.3.6.1.4.1.318.1.1.1.3.2.4.0"
       [[inputs.snmp.field]]
          name = "lastTransferReason"
          oid = "iso.1.3.6.1.4.1.318.1.1.1.3.2.5.0"
       [[inputs.snmp.field]]
          name = "outputVoltage"
          oid = "iso.1.3.6.1.4.1.318.1.1.1.4.2.1.0"
       [[inputs.snmp.field]]
          name = "outputFreq"
          oid = "iso.1.3.6.1.4.1.318.1.1.1.4.2.2.0"
       [[inputs.snmp.field]]
   name = "outputLoad"
      oid = "iso.1.3.6.1.4.1.318.1.1.1.4.2.3.0"
   [[inputs.snmp.field]]
      name = "ouputCurrent"
      oid = "iso.1.3.6.1.4.1.318.1.1.1.4.2.4.0"
   [[inputs.snmp.field]]
      name = "lastSelfTestResult"
      oid = "iso.1.3.6.1.4.1.318.1.1.1.7.2.3.0"
   [[inputs.snmp.field]]
      name = "lastSelfTestDate"
      oid = "iso.1.3.6.1.4.1.318.1.1.1.7.2.4.0"
  </code></pre>
  
  <p><strong>Ouput of telegraf --test --config UPS.conf</strong> - Notice the hostname on each, one is 121, one is 91, 82 etc. The upsType field also comes through as a string, but is being converted to a number.</p>
  
  <pre><code>* Plugin: inputs.snmp, Collection 1
  &gt; snmp,hostname=121,upsType=122,agent_host=192.168.15.60,host=HEAGrafana batteryTemp=124i,inputVoltage=127i,outputFreq=131i,outputLoad=132i,lastSelfTestDate=135i,outputVoltage=130i,ouputCurrent=133i,lastSelfTestResult=134i,batteryCapacityPercent=123i,batteryRuntimeRemain=125i,batteryReplace=126i,inputFreq=128i,lastTransferReason=129i 1527721763000000000
  &gt; snmp,host=HEAGrafana,hostname=103,upsType=104,agent_host=192.168.15.64 batteryCapacityPercent=105i,batteryReplace=108i,inputFreq=110i,lastTransferReason=111i,lastSelfTestResult=116i,ouputCurrent=115i,lastSelfTestDate=117i,batteryTemp=106i,batteryRuntimeRemain=107i,inputVoltage=109i,outputVoltage=112i,outputFreq=113i,outputLoad=114i 1527721764000000000
  &gt; snmp,hostname=91,upsType=92,agent_host=192.168.15.65,host=HEAGrafana lastSelfTestDate=105i,batteryTemp=94i,inputVoltage=97i,inputFreq=98i,outputFreq=101i,outputLoad=102i,ouputCurrent=103i,lastSelfTestResult=104i,batteryCapacityPercent=93i,batteryRuntimeRemain=95i,batteryReplace=96i,lastTransferReason=99i,outputVoltage=100i 1527721766000000000
  &gt; snmp,hostname=82,upsType=83,agent_host=192.168.15.66,host=HEAGrafana batteryReplace=87i,inputVoltage=88i,inputFreq=89i,lastTransferReason=90i,outputLoad=93i,batteryCapacityPercent=84i,batteryTemp=85i,batteryRuntimeRemain=86i,lastSelfTestResult=95i,lastSelfTestDate=96i,outputVoltage=91i,outputFreq=92i,ouputCurrent=94i 1527721768000000000
  &gt; snmp,hostname=61,upsType=62,agent_host=192.168.15.67,host=HEAGrafana lastTransferReason=69i,outputVoltage=70i,outputFreq=71i,outputLoad=72i,batteryTemp=64i,batteryReplace=66i,inputVoltage=67i,inputFreq=68i,lastSelfTestDate=75i,batteryCapacityPercent=63i,batteryRuntimeRemain=65i,ouputCurrent=73i,lastSelfTestResult=74i 1527721769000000000
  </code></pre>
  
  <p><strong>Output of snmpget -v2c -c heabc  192.168.15.60 .1.3.6.1.4.1.318.1.1.1.1.1.1.0</strong>  - It returns a string.</p>
  
  <pre><code>iso.3.6.1.4.1.318.1.1.1.1.1.1.0 = STRING: "Smart-UPS X 3000"
  </code></pre>