# Parse and convert string SNMP input

**URL:** <https://community.influxdata.com/t/parse-and-convert-string-snmp-input/12785>\
**Category:** Telegraf\
**Tags:** telegraf\
**Created:** [January 28, 2020, 7:35am UTC](https://community.influxdata.com/t/parse-and-convert-string-snmp-input/12785 "2020-01-28T07:35:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmdag](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/tmdag/32/4277_2.png) [@tmdag](https://community.influxdata.com/u/tmdag)\
**Post date:** [January 28, 2020, 7:35am UTC](https://community.influxdata.com/t/parse-and-convert-string-snmp-input/12785/1 "2020-01-28T07:35:05Z")

</div>

My SNMP provides some data in strings instead of floats:  
$ snmpget -v1 -Cf -c public 192.168.0.2 NAS-MIB::systemFreeMem.0

> NAS-MIB::systemFreeMem.0 = STRING: “7519.2 MB”

Is there a way I could parse this data ?

I have checked ‘converter’ plugin ([telegraf/plugins/processors/converter at master · influxdata/telegraf · GitHub](https://github.com/influxdata/telegraf/tree/master/plugins/processors/converter))  
as well as SNMP ‘conversion’ field parameter but those assume that string is a numeric value.

I am looking for something like regex input like:  
[https://docs.cacti.net/manual:088:3a\_advanced\_topics.3b\_snmp\_data\_query\_walkthrough#value\_regexp\_in\_action](https://docs.cacti.net/manual:088:3a_advanced_topics.3b_snmp_data_query_walkthrough#value_regexp_in_action)

Unless you have other suggestions ?

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)\
**Post date:** [February 4, 2020, 9:35pm UTC](https://community.influxdata.com/t/parse-and-convert-string-snmp-input/12785/2 "2020-02-04T21:35:20Z")

</div>

The best you could probably do today is use the `regex` processor to remove the `" MB"` section, and then use the `converter` to convert the remaining numeric string to a float. However, I worry that you might still have an issue if the units can change.
