Documentation
¶
Overview ¶
Package formatterimpl implements the formatter component.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MockModule ¶
MockModule provides a dummy formatter that just hashes packets.
Types ¶
type JSONFormatter ¶
type JSONFormatter struct {
// contains filtered or unexported fields
}
JSONFormatter is a Formatter implementation that transforms Traps into JSON
func (JSONFormatter) FormatPacket ¶
func (f JSONFormatter) FormatPacket(packet *packet.SnmpPacket) ([]byte, error)
FormatPacket converts a raw SNMP trap packet to a FormattedSnmpPacket containing the JSON data and the tags to attach
{
"trap": {
"ddsource": "snmp-traps",
"ddtags": "namespace:default,snmp_device:10.0.0.2,...",
"timestamp": 123456789,
"snmpTrapName": "...",
"snmpTrapOID": "1.3.6.1.5.3.....",
"snmpTrapMIB": "...",
"uptime": "12345",
"genericTrap": "5", # v1 only
"specificTrap": "0", # v1 only
"variables": [
{
"oid": "1.3.4.1....",
"type": "integer",
"value": 12
},
...
],
}
}
Click to show internal directories.
Click to hide internal directories.