I use Python2.7 send data to the logstash above, the use of ordinary TCP port data transmission.
msgDict["@metadata"] = {
"beat":"python-test",
"type":"python"
}
msgDict["@timestamp"] = time.strftime("%Y-%m-%dT%H:%M:%S",now)
msgDict["tags"] = ["python","192.168.4.15"]
msgDict["type"] = "python"
tcpsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_address = ("127.0.0.1", 5044)
tcpsock.connect(server_address)
msg = dumps(msgDict) + "\n"
tcpsock.sendall(msg)
tcpsock.close()
But logstash accepted after the show format is not correct, what is
the reason for the formation of.Lumberjack_formatter-0.1.4 also
installed
[33mBeats Input: Remote connection closed {:peer=>"192.168.59.198:64911", :exception=>#Lumberjack::Beats::Connection::ConnectionClosed: Lumberjack::Beats::Connection::ConnectionClosed wrapping: Lumberjack::Beats::Parser::UnsupportedProtocol, unsupported protocol 123>, :level=>:warn}
[33mBeats Input: Remote connection closed {:peer=>"127.0.0.1:56536", :exception=>#Lumberjack::Beats::Connection::ConnectionClosed: Lumberjack::Beats::Connection::ConnectionClosed wrapping: Lumberjack::Beats::Parser::UnsupportedProtocol, unsupported protocol 123>, :level=>:warn}
[33mBeats Input: Remote connection closed {:peer=>"127.0.0.1:58986", :exception=>#Lumberjack::Beats::Connection::ConnectionClosed: Lumberjack::Beats::Connection::ConnectionClosed wrapping: Lumberjack::Beats::Parser::UnsupportedProtocol, unsupported protocol 39>, :level=>:warn}
logstash configure file content
input {
beats {
port => 5044
}
}
Logstash both to accept the beat source data, but also want to let him accept user defined data
Thanks