refactor and add logstash mongodb,esearch script