# Node-RED + Elasticsearch

**URL:** <https://discourse.nodered.org/t/node-red-elasticsearch/1640>\
**Category:** General\
**Created:** [17 July 2018 14:45 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640 "2018-07-17T14:45:00Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhoemio](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@Bhoemio](https://discourse.nodered.org/u/Bhoemio)\
**Post date:** [17 July 2018 14:45 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/1 "2018-07-17T14:45:00Z")

</div>

Hi,  
I am trying to send data from Node-RED to Elasticsearch, but I receive the following error after deploy the time stamp:

Elasticsearch ERROR: 2018-07-17T14:30:15Z  
Error: Request error, retrying  
HEAD [http://localhost/twitterr/tweets/1](http://localhost/twitterr/tweets/1) =\> connect ECONNREFUSED 127.0.0.1:80  
at Log.error (/home/workdb/.node-red/node\_modules/elasticsearch/src/lib/log.js:225:56)  
at checkRespForFailure (/home/workdb/.node-red/node\_modules/elasticsearch/src/lib/transport.js:258:18)  
at HttpConnector. (/home/workdb/.node-red/node\_modules/elasticsearch/src/lib/connectors/http.js:157:7)  
at ClientRequest.bound (/home/workdb/.node-red/node\_modules/elasticsearch/node\_modules/lodash/dist/lodash.js:729:21)  
at emitOne (events.js:116:13)  
at ClientRequest.emit (events.js:211:7)  
at Socket.socketErrorListener (\_http\_client.js:387:9)  
at emitOne (events.js:116:13)  
at Socket.emit (events.js:211:7)  
at emitErrorNT (internal/streams/destroy.js:64:8)  
at \_combinedTickCallback (internal/process/next\_tick.js:138:11)  
at process.\_tickCallback (internal/process/next\_tick.js:180:9)

Elasticsearch WARNING: 2018-07-17T14:30:15Z  
Unable to revive connection: [http://localhost/](http://localhost/)

Elasticsearch WARNING: 2018-07-17T14:30:15Z  
No living connections

17 Jul 11:30:15 - [error] [es-exists:cee9ae59.c86a2] Error: No Living connection

I am using this library:  
node-red-contrib-elasticsearch-continued  
0.1.0

Anyone knows how to fix this?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [17 July 2018 15:35 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/2 "2018-07-17T15:35:56Z")

</div>

Well my guess - based on the log - is you don’t have a connection to the server and you need to fix that

---

<div class="post-metadata">

**Author:** ![Bhoemio](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@Bhoemio](https://discourse.nodered.org/u/Bhoemio)\
**Post date:** [17 July 2018 16:50 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/3 "2018-07-17T16:50:26Z")

</div>

Thank you for the reply!  
When I tested in Node.js everything is ok, but in Node-RED it doens't work 😕

---

<div class="post-metadata">

**Author:** ![Bhoemio](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@Bhoemio](https://discourse.nodered.org/u/Bhoemio)\
**Post date:** [17 July 2018 17:07 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/4 "2018-07-17T17:07:04Z")

</div>

Ok, maybe I just fix this haha, but there is a new error:

17 Jul 14:00:47 - [error] [get:4c6969c1.2bdd08] ReferenceError: documentType is not defined

My goodness

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [17 July 2018 17:43 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/5 "2018-07-17T17:43:26Z")

</div>

And where is that error coming from?

Not having your flow (and since I don't even know what 'elasticsearch' search is, it probably wouldn't help) it is hard to guess where that message is from.

You might want to add a 'catch' node connected to a debug node (omplete msg object) and see what that gives you in the debug panel

---

<div class="post-metadata">

**Author:** ![Bhoemio](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@Bhoemio](https://discourse.nodered.org/u/Bhoemio)\
**Post date:** [17 July 2018 18:13 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/6 "2018-07-17T18:13:44Z")

</div>

When I use catch node other nodes doesn't work 😕

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/6/6379740a34145847b61f27d961bbd5b6cb555c61.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/58c798147d43d9309ff7688f1cb4744710836667.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/9ad96ab26258bbca4cadc40a1348be0f314c7af9.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [17 July 2018 18:44 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/7 "2018-07-17T18:44:27Z")

</div>

I believe if you look at the debug panel where the error mesage is showing, in the first line it shows the time and node. If you click on the node number, it will highlight which node the message is coming from.

so which node is it?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [17 July 2018 18:55 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/8 "2018-07-17T18:55:10Z")

</div>

Have you tried leaving the ID, index and type blank and passing them to the node in the message?

Or open an issue against the node on github.

---

<div class="post-metadata">

**Author:** ![Bhoemio](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@Bhoemio](https://discourse.nodered.org/u/Bhoemio)\
**Post date:** [17 July 2018 18:57 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/9 "2018-07-17T18:57:08Z")

</div>

The GET node are making troubles haha.  
Well, leaving just Output Elasticsearch node I get another error o///

"RangeError: Maximum call stack size exceeded"

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/a7f7eed733c09f44d8ae98cff75a8c5a9d459d4f.png)

---

<div class="post-metadata">

**Author:** ![Bhoemio](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@Bhoemio](https://discourse.nodered.org/u/Bhoemio)\
**Post date:** [17 July 2018 18:58 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/10 "2018-07-17T18:58:47Z")

</div>

I tried, but I get this error:

TypeError: Unable to build a path with those params. Supply at least index, type, id.

About github, this is a good idea.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [17 July 2018 19:39 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/11 "2018-07-17T19:39:09Z")

</div>

so what message did you send ?

---

<div class="post-metadata">

**Author:** ![realjax](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realjax/32/895_2.png) [@realjax](https://discourse.nodered.org/u/realjax)\
**Post date:** [19 July 2018 12:15 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/12 "2018-07-19T12:15:00Z")

</div>

No offense, but it seems to me you need to first get a better grasp of Elastic. The errors you report are due to incorrect use of this ( excellent) search engine.

---

<div class="post-metadata">

**Author:** ![anmobor](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@anmobor](https://discourse.nodered.org/u/anmobor)\
**Post date:** [28 August 2020 12:16 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/13 "2020-08-28T12:16:41Z")

</div>

No offense, but may you explain how this excellent search engine works? We would appreciate it very much if you show us how to set it up correctly

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [28 August 2020 12:37 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/14 "2020-08-28T12:37:30Z")

</div>

Hi @anmobor,

this topic is over 2 years old. If you have a new question about ElasticSearch and Node-RED, it would be better to start a new topic.

---

<div class="post-metadata">

**Author:** ![anmobor](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@anmobor](https://discourse.nodered.org/u/anmobor)\
**Post date:** [28 August 2020 12:42 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/15 "2020-08-28T12:42:42Z")

</div>

Hi @knolleary I am trying to do the same and I don't see any answer with a solution. Do you want me to open another topic with the same question?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [28 August 2020 12:45 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/16 "2020-08-28T12:45:49Z")

</div>

Do you mean you are hitting the same error as the original question:

> Elasticsearch ERROR: 2018-07-17T14:30:15Z  
> Error: Request error, retrying  
> HEAD [http://localhost/twitterr/tweets/1](http://localhost/twitterr/tweets/1) =\> connect ECONNREFUSED 127.0.0.1:80

Or something else?

As you can see, a number of questions were asked about what the user was trying to do that went unanswered. If you want help, you'll need to explain in more detail what you are trying to do, what you have done so far, and what is not working.

Given this thread is 2 years old, it may make sense for you to ask it as a new thread, otherwise your question may get overlooked.

---

<div class="post-metadata">

**Author:** ![anmobor](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@anmobor](https://discourse.nodered.org/u/anmobor)\
**Post date:** [28 August 2020 12:49 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/17 "2020-08-28T12:49:19Z")

</div>

@knolleary you are right, I will open a new one

---

<div class="post-metadata">

**Author:** ![anmobor](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@anmobor](https://discourse.nodered.org/u/anmobor)\
**Post date:** [1 September 2020 08:34 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/18 "2020-09-01T08:34:14Z")

</div>

@knolleary you are right. There's no need to open a new one because I solved the problem using the component 'elasticsearch-cient node' and setting the field Elastic cloud with the cluster id the user and password, it worked perfectly, I sent the msg.payload in the append field and I could store to elasticsearch perfectly.

Thank you

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [1 September 2020 12:56 UTC](https://discourse.nodered.org/t/node-red-elasticsearch/1640/19 "2020-09-01T12:56:11Z")

</div>


