# How to send Dstream to Elasticsearch?

**URL:** <https://discuss.elastic.co/t/how-to-send-dstream-to-elasticsearch/24392>\
**Category:** Elasticsearch\
**Created:** [June 26, 2015, 3:26am UTC](https://discuss.elastic.co/t/how-to-send-dstream-to-elasticsearch/24392 "2015-06-26T03:26:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![reza\_asad](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@reza\_asad](https://discuss.elastic.co/u/reza_asad)\
**Post date:** [June 26, 2015, 3:26am UTC](https://discuss.elastic.co/t/how-to-send-dstream-to-elasticsearch/24392/1 "2015-06-26T03:26:04Z")

</div>

I'm wondering if there's a way to send Dstreams from spark streaming to Elasticsearch directly.  
I'm aware that you can use foreachRDD and send each rdd to elasticsearch. But I'm wondering  
if I can send them directly as foreachRDD is expensive. Thanks.

---

<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 6, 2017, 12:05am UTC](https://discuss.elastic.co/t/how-to-send-dstream-to-elasticsearch/24392/2 "2017-07-06T00:05:19Z")

</div>


