# Logstash snmptrap

**URL:** <https://discuss.elastic.co/t/logstash-snmptrap/144674>\
**Category:** Logstash\
**Created:** [August 16, 2018, 9:36am UTC](https://discuss.elastic.co/t/logstash-snmptrap/144674 "2018-08-16T09:36:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jianming](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@jianming](https://discuss.elastic.co/u/jianming)\
**Post date:** [August 16, 2018, 9:36am UTC](https://discuss.elastic.co/t/logstash-snmptrap/144674/1 "2018-08-16T09:36:19Z")

</div>

hi all:

```
    i want to use logstash-snmptrap collect snmp message, i see the logstash'log no say any error, but elasticsearch-head no any index .
   i use "snmptrap -v 2c -c public 172.32.1.2:1062 '' 1.3.6.1.4.1.8072.2.3.0.1 1.3.6.1.4.1.8072.2.3.2.1 i 123456" with another linux to send the command. no problem.
 i don't know how to write the .conf for the snmp ? 
i check "/usr/share/logstash/bin/logstash -f snmp.conf -t" is ok .

```

i don't know how to send to elasticsearch .

[root@elk-test conf.d]# /usr/share/logstash/bin/logstash -f system.conf -t  
WARNING: Could not find logstash.yml which is typically located in $LS\_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults  
Could not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the console  
[WARN] 2018-08-16 17:33:52.556 [LogStash::Runner] multilocal - Ignoring the 'pipelines.yml' file because modules or command line options are specified  
Configuration OK  
[INFO] 2018-08-16 17:33:59.665 [LogStash::Runner] runner - Using config.test\_and\_exit mode. Config Validation Result: OK. Exiting Logstash

input {  
snmptrap {  
#id =\> "0001"  
community =\> ["public"]  
host =\> "0.0.0.0"  
port =\> 1602  
type =\> "snmplog"  
}  
}  
output {  
elasticsearch {  
hosts =\> ["172.32.1.2:9200"]  
index =\> "snmplog-%{+YYYY.MM.dd}"  
}  
}

---

<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:** [September 13, 2018, 9:36am UTC](https://discuss.elastic.co/t/logstash-snmptrap/144674/2 "2018-09-13T09:36:21Z")

</div>

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