# Logstash snmp output

**URL:** https://discuss.elastic.co/t/logstash-snmp-output/233486
**Category:** Logstash
**Created:** [May 20, 2020, 8:19am UTC](https://discuss.elastic.co/t/logstash-snmp-output/233486 "2020-05-20T08:19:36Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![PraveenKT](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/praveenkt/32/35483_2.png) [@PraveenKT](https://discuss.elastic.co/u/PraveenKT)
#### Post date: [May 20, 2020, 8:19am UTC](https://discuss.elastic.co/t/logstash-snmp-output/233486/1 "2020-05-20T08:19:37Z")

</div>

i am successfully SNMP polling the network device. But fields in output are OID. how do i get proper fields. Below is example output.

++++++++++++++++++++++++++++++++++++++++  
"host" =\> "x.x.x.x",  
_" **iso.org.dod.internet.mgmt.mib-2.ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifName.10101**"_ =\> "Gi1/0/1",  
"@version" =\> "1",  
"type" =\> "snmpv2",  
"@timestamp" =\> 2020-05-20T08:01:42.315Z,  
"tags" =\> [  
[0] "LOGSTASH",  
[1] "INHY",  
[2] "SNMPv2"  
]  
+++++++++++++++++++++++++++++++++++++++++++++++

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [May 20, 2020, 3:59pm UTC](https://discuss.elastic.co/t/logstash-snmp-output/233486/2 "2020-05-20T15:59:42Z")

</div>

> [@PraveenKT](#):
>
> how do i get proper fields.

What do you think is "proper"?

---

<div class="post-metadata">

### Author: ![PraveenKT](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/praveenkt/32/35483_2.png) [@PraveenKT](https://discuss.elastic.co/u/PraveenKT)
#### Post date: [May 20, 2020, 5:53pm UTC](https://discuss.elastic.co/t/logstash-snmp-output/233486/3 "2020-05-20T17:53:13Z")

</div>

field names. like interface, cpu utilization, memory free, memory used, etc, instead of OID

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [May 20, 2020, 9:08pm UTC](https://discuss.elastic.co/t/logstash-snmp-output/233486/4 "2020-05-20T21:08:04Z")

</div>

If you want to trim iso.org.dod.internet.mgmt.mib-2.ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifName.10101 down to just ifName you could use something similar to [this](https://discuss.elastic.co/t/rename-snmp-dynamic-fields/208236/4). Obviously you would have to change the if and add a second gsub to strip the leading elements of the name.

---

<div class="post-metadata">

### Author: ![PraveenKT](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/praveenkt/32/35483_2.png) [@PraveenKT](https://discuss.elastic.co/u/PraveenKT)
#### Post date: [May 27, 2020, 8:25am UTC](https://discuss.elastic.co/t/logstash-snmp-output/233486/5 "2020-05-27T08:25:10Z")

</div>

Below is stdout. Is tehere any another option other than conversion like you told.

```````````````````````````````auto
"iso.org.dod.internet.mgmt.mib-2.ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifHCOutOctets.3" => 1005966852480,
                                                                                "@version" => "1",
                         "iso.org.dod.internet.private.enterprises.12356.101.12.2.1.4.2.1" => "error: no such instance currently exists at this OID",
                       "iso.org.dod.internet.private.enterprises.12356.101.12.2.2.1.6.2.1" => "103.44.2.78",
          "iso.org.dod.internet.mgmt.mib-2.ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifAlias.4" => "act",
                "iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifOutOctets.3" => 944505216,
                                                                                "hostsnmp" => "10.252.255.1",
     "iso.org.dod.internet.mgmt.mib-2.ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifHCInOctets.4" => 445503968,
                       "iso.org.dod.internet.private.enterprises.12356.101.12.2.2.1.4.2.1" => "155.94.153.1",
                                                                                    "type" => "snmpv2"
}
{
                 "iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifInOctets.3" => 4268568351,
                       "iso.org.dod.internet.private.enterprises.12356.101.12.2.2.1.2.2.1" => "inhy-to-usla-1",
          "iso.org.dod.internet.mgmt.mib-2.ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifAlias.3" => "pioneer",
           "iso.org.dod.internet.mgmt.mib-2.ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifName.3" => "port1",
    "iso.org.dod.internet.mgmt.mib-2.ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifHCOutOctets.4" => 39305728,
      "iso.org.dod.internet.mgmt.mib-2.ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifHighSpeed.3" => 1000,
     "iso.org.dod.internet.mgmt.mib-2.ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifHCInOctets.3" => 1206859411231,
                                                                              "@timestamp" => 2020-05-27T08:19:28.719Z,
                                                                                    "tags" => [
        [0] "ISSQLOGSTASH",
        [1] "INHY",
        [2] "SNMPv2"
    ],
    "iso.org.dod.internet.mgmt.mib-2.ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifHCOutOctets.3" => 1005966998838,
                                                                                "@version" => "1",
                         "iso.org.dod.internet.private.enterprises.12356.101.12.2.1.4.2.1" => "error: no such instance currently exists at this OID",
                       "iso.org.dod.internet.private.enterprises.12356.101.12.2.2.1.6.2.1" => "103.44.2.78",
          "iso.org.dod.internet.mgmt.mib-2.ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifAlias.4" => "act",
                "iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifOutOctets.3" => 944651574,
                                                                                "hostsnmp" => "10.252.255.1",
     "iso.org.dod.internet.mgmt.mib-2.ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifHCInOctets.4" => 445504032,
                       "iso.org.dod.internet.private.enterprises.12356.101.12.2.2.1.4.2.1" => "155.94.153.1",
                                                                                    "type" => "snmpv2"

``````````````````````````````
```````````````````````````````

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [June 24, 2020, 8:25am UTC](https://discuss.elastic.co/t/logstash-snmp-output/233486/6 "2020-06-24T08:25:15Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
