How to write output to avro file from logstash using avro codec

You mean "using Logstash", right? You already have a thread for this; Unable to write to avro file from logstash. Let's not fragment the discussion.