# Retrieving latest documents from elasticsearch

**URL:** <https://discuss.elastic.co/t/retrieving-latest-documents-from-elasticsearch/184178>\
**Category:** Elasticsearch\
**Created:** [June 4, 2019, 12:41pm UTC](https://discuss.elastic.co/t/retrieving-latest-documents-from-elasticsearch/184178 "2019-06-04T12:41:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lecko](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@lecko](https://discuss.elastic.co/u/lecko)\
**Post date:** [June 4, 2019, 12:41pm UTC](https://discuss.elastic.co/t/retrieving-latest-documents-from-elasticsearch/184178/1 "2019-06-04T12:41:25Z")

</div>

This is probably very basic question. I did some research but cant find answer.

I have acces to some third party app, that collects data from over 200 machines into one elasticsearch, it si version 2.x . I can acces this elasticsearch using RESt, I can do curl commands.

Now what I would liketo do is filter the documents in that elasticsearch and forward them to our company LOG collecting server.

I see 2 ways of doing that:

1. I run every 15 minutes a script that forwards all documents younger that 15 minutes to that LOG server
2. I run every 15 minutes a script that filters the latest documents and forweards only selected ones to the LOG server.

Thank you.

---

<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:** [July 2, 2019, 12:41pm UTC](https://discuss.elastic.co/t/retrieving-latest-documents-from-elasticsearch/184178/2 "2019-07-02T12:41:35Z")

</div>

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