Requirement to build logstah core module to generate a custom logstah for a specific purpose

I'm sure it is possible, but I would have no idea where to start.

You can also achieve it in logstash by linking a udp output to a udp input. See this thread.