Hi I am a Logstash newbie. I am using python-ipfix module to generate IPFIX Packets and send it to LogStash on Localhost over port 10000. However, I am hitting the error - Ignoring Netflow version v10 {:level=>:warn} in Logstash. I have not changed anything in the yaml file for netflow.
Here is my Python Code for generating the IPFIX Packets -
import socket
import sys
# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Connect the socket to the port where the server is listening
server_address = ('localhost', 10000)
print('connecting to %s port %s' % server_address)
sock.connect(server_address)
#Import Requisite Modules
import ipfix.ie
import ipfix.template
import ipfix.message
from ipaddress import ip_address
rec = { "sourceIPv4Address" : ip_address("10.1.2.3"),"destinationIPv4Address" : ip_address("10.5.6.7")}
rec1 = { "sourceIPv4Address" : ip_address("10.1.2.4"),"destinationIPv4Address" : ip_address("10.5.6.6")}
#Information Elements Definition
ipfix.ie.use_iana_default()
#Template Definition
tmpl = ipfix.template.from_ielist(256,ipfix.ie.spec_list(("sourceIPv4Address","destinationIPv4Address")))
print(tmpl)
#Message Definition
msg = ipfix.message.MessageBuffer()
msg.begin_export(8304)
msg.add_template(tmpl)
print(msg)
msg.export_ensure_set(256)
print(msg)
msg.export_namedict(rec)
msg.export_namedict(rec1)
print(msg)
b = msg.to_bytes()
msg.begin_export()
print(msg)
try:
# Send data
message = b
print('sending "%s"' % message)
sock.sendall(message)
finally:
print('closing socket')
sock.close()
My Logstash config file looks like this -
input {
tcp {
host => localhost
port => 10000
codec => netflow {}
type => ipfix
}
}
output {
stdout { codec => rubydebug }
}
Please help me resolve this issue. Many thanks in advance