How can i create logstash index every 4 hours except 1 hour

You should just use ILM to manage this for you, it'd be a lot easier.