# SNMPTrap not reading snmp traffic through logstash

**URL:** https://discuss.elastic.co/t/snmptrap-not-reading-snmp-traffic-through-logstash/56199
**Category:** Logstash
**Created:** [July 22, 2016, 5:49pm UTC](https://discuss.elastic.co/t/snmptrap-not-reading-snmp-traffic-through-logstash/56199 "2016-07-22T17:49:37Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![jpcarey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpcarey/32/46668_2.png) [@jpcarey](https://discuss.elastic.co/u/jpcarey)
#### Post date: [July 25, 2016, 4:08pm UTC](https://discuss.elastic.co/t/snmptrap-not-reading-snmp-traffic-through-logstash/56199/5 "2016-07-25T16:08:11Z")

</div>

> [@apomerenk](#):
>
> I am seeing traffic generated to ports snmptrap (162), lxi-eventsc (5044), and swxadmin (5043). I changed my config port to listen on all of these and still nothing in Logstash.

I am confused as to what you have configured.

This worked fine for me (I used the default 1062 port, rather than the privileged 162 - but should this should not matter)

### Logstash config

```auto
input {
  snmptrap {}
}

filter {
}

output {
  stdout {
    codec => rubydebug { metadata => true }
  }
}

```

### Test trap command

```auto
$ snmptrap -v 2c -c public localhost:1062 '' .1.3.6.1.6.3.1.1.5.3 ifIndex i 2 ifAdminStatus i 1 ifOperStatus i 1

```

### Logstash stdout

```auto
logstash-2.3.2$ bin/logstash -f ../logstash-snmp.config
Settings: Default pipeline workers: 4
Pipeline main started
{
                      "message" => "#<SNMP::SNMPv2_Trap:0x37c613c @request_id=1803122945, @error_index=0, @error_status=0, @source_ip=\"127.0.0.1\", @varbind_list=[#<SNMP::VarBind:0x42416b07 @name=[1.3.6.1.2.1.1.3.0], @value=#<SNMP::TimeTicks:0x13dc79f2 @value=59480382>>, #<SNMP::VarBind:0x73c98f34 @name=[1.3.6.1.6.3.1.1.4.1.0], @value=[1.3.6.1.6.3.1.1.5.3]>, #<SNMP::VarBind:0x6bbec36b @name=[1.3.6.1.2.1.2.2.1.1], @value=#<SNMP::Integer:0x226e9448 @value=2>>, #<SNMP::VarBind:0x528d6a1e @name=[1.3.6.1.2.1.2.2.1.7], @value=#<SNMP::Integer:0x6d02ef54 @value=1>>, #<SNMP::VarBind:0x70bacc04 @name=[1.3.6.1.2.1.2.2.1.8], @value=#<SNMP::Integer:0x2620ca8f @value=1>>]>",
                         "host" => "127.0.0.1",
                     "@version" => "1",
                   "@timestamp" => "2016-07-25T16:03:32.834Z",
      "SNMPv2-MIB::sysUpTime.0" => "6 days, 21:13:23.82",
    "SNMPv2-MIB::snmpTrapOID.0" => "IF-MIB::linkDown",
              "IF-MIB::ifIndex" => "2",
        "IF-MIB::ifAdminStatus" => "1",
         "IF-MIB::ifOperStatus" => "1"
}

```

Maybe post the details of the trap from tcpdump?

---

_[View the full topic](https://discuss.elastic.co/t/snmptrap-not-reading-snmp-traffic-through-logstash/56199)._
