Rewrite it to use Elasticsearch directly instead of using Logstash