How to receive the file over a socket which is a input to logstash

Hi,

I need to send a file over a socket connection (in 1024 bytes blocks) to a logstash service. I am trying to achieve this through python. The logstash service should use this as an input and parse the same.

Is there any way to write an input plugin to receive the above file and use this as an input?

I don't think there's a stock plugin that allows you to receive data over a socket connection and store the whole session in a new event. Seems like a good fit for a codec though. But it's if course easy if you write an input plugin—read everything from the socket into a buffer and stuff the buffer into an event. This obviously assumes that the size of the file being received is reasonably small.