Split elasticsearch file and add loggin