Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agent Address field of SNMPV1 Trap is coming as combination of hexadecimal and ASCII value #52

Open
jkrishnak opened this issue Apr 2, 2019 · 2 comments

Comments

@jkrishnak
Copy link

When trying to extract fields of SNMPv1 trap from logstash output. Here is my pipeline:

image

And This is what I see in output:

image

Here, agent address is coming as combination of hexadecimal and ASCII value.

"agent_address" => ""\xFFA\xFFA""

I need agent address in IP Address format( like 1.1.1.1) .

@dstracha
Copy link

dstracha commented Aug 2, 2022

Did this ever get resolved? having the same issue.

@edmocosta edmocosta transferred this issue from logstash-plugins/logstash-input-snmptrap May 9, 2024
@edmocosta
Copy link
Contributor

Hey there,

We've moved this issue into this new SNMP integration plugin, which combines the logstash-input-snmp and logstash-input-snmptrap plugins into one.

Considering we've switched the underline library from ruby-snmp to snmp4j, I'd suggest you to upgrade to this integration plugin (migration guide) and try it again.

Please note that the new plugin introduced a few breaking changes compared to individual one, for example, your grok filter won't work as expected, as the message field format has changed. As an alternative, you could get those values from the metadata fields (SNMPv1 only): [@metadata][input][snmptrap][pdu][agent_addr], [@metadata][input][snmptrap][pdu][enterprise], [@metadata][input][snmptrap][pdu][generic_trap], [@metadata][input][snmptrap][pdu][specific_trap], and so on, e.g:

input {
   snmptrap {
       ...
       add_field => { 
          "agent_address" => "%{[@metadata][input][snmptrap][pdu][agent_addr]}"
          "generic_trap" => "%{[@metadata][input][snmptrap][pdu][generic_trap]}"
           ...
       }
   }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants