# Reading new data from elastic using logstash to rabbitMQ

**URL:** <https://discuss.elastic.co/t/reading-new-data-from-elastic-using-logstash-to-rabbitmq/342844>\
**Category:** Logstash\
**Created:** [September 12, 2023, 1:51pm UTC](https://discuss.elastic.co/t/reading-new-data-from-elastic-using-logstash-to-rabbitmq/342844 "2023-09-12T13:51:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shay\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shay_hershko/32/125104_2.png) [@Shay\_Hershko](https://discuss.elastic.co/u/Shay_Hershko)\
**Post date:** [September 12, 2023, 1:51pm UTC](https://discuss.elastic.co/t/reading-new-data-from-elastic-using-logstash-to-rabbitmq/342844/1 "2023-09-12T13:51:59Z")

</div>

Hi, I want to send every new data entered to index in elastic to a RabbitMQ queue every second.  
I tried using logstash for it but for some reason it send all the data and not just the new one.  
I saw you can use time stamp and then use it to only get the new data but I didn't understand how to make it so every new document automatically add that field when added to the index.

here is the logstash conf :

```auto
input {
  elasticsearch {
    hosts => ["http://localhost:9200"]
    index => "test_index"
    docinfo => true
    codec => json
    schedule => "* * * * *"
  }
}

output {
  rabbitmq {
    host => "localhost"
    port => 5762
    exchange => "test"
    exchange_type => "direct"
    key => ""
    durable => true
    persistent => true
    user => "guest"
    password => "guest"
  }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 10, 2023, 1:52pm UTC](https://discuss.elastic.co/t/reading-new-data-from-elastic-using-logstash-to-rabbitmq/342844/2 "2023-10-10T13:52:54Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
