# Split a Response from an SSH Client

**URL:** <https://discourse.nodered.org/t/split-a-response-from-an-ssh-client/60927>\
**Category:** General\
**Tags:** function-node\
**Created:** [7 April 2022 08:57 UTC](https://discourse.nodered.org/t/split-a-response-from-an-ssh-client/60927 "2022-04-07T08:57:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sven\_Erik](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@Sven\_Erik](https://discourse.nodered.org/u/Sven_Erik)\
**Post date:** [7 April 2022 08:57 UTC](https://discourse.nodered.org/t/split-a-response-from-an-ssh-client/60927/1 "2022-04-07T08:57:05Z")

</div>

Hi,  
im new to Nodered and need some help with my project.  
All in all I have an SSH Client which gets an Command from Nodered and I need to Split the Response into single parts. The Response Shows some text and coords. I need to take the X[m] and Y[m] coords to send an signal when they are in defined range. "Like X[m]= 2.4 until 2.6"  
I thought of an Array to split them. But with the "function node" Im not able to create an array. Also my "session.stdout[0] is not defined.  
Can you give me some infos, how I need to convert the output of my SSH client for using just the coords ?

 ![Fehler_node_red](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/e/4e2828aa68a99bc4d691ffffc581c1d15a342426.png)  
 ![Node_red_robotino](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/5/75f632a4397bdcc79ebdaea8d14c8bd2bddc53b3.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:** [7 April 2022 09:35 UTC](https://discourse.nodered.org/t/split-a-response-from-an-ssh-client/60927/2 "2022-04-07T09:35:47Z")

</div>

You need to use `msg.session.stdout[0]` to reference it.

There’s a great page in the docs ([Working with messages : Node-RED](https://nodered.org/docs/user-guide/messages)) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

![BX00Cy7yHi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd1f333a9e043b061b39917c328b0094d3e52d30.gif)

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [7 April 2022 09:57 UTC](https://discourse.nodered.org/t/split-a-response-from-an-ssh-client/60927/3 "2022-04-07T09:57:06Z")

</div>

Forgive me if zenofmud's answer makes this irrelevant...

Assuming that you get a message looking like this  
 ![Untitled 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/7/4702a0371f832da80973adc2f84126c0fadb2306.jpeg)

then a function like this will extract the x and y values as a Javascript object making them much easier to access.  
 ![Untitled 3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/4/b43ef36691a245da87ee3f08b660cdd166ee2111.jpeg)

But if you have control of the device sending the message, you could send the data in object format.

---

<div class="post-metadata">

**Author:** ![Sven\_Erik](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@Sven\_Erik](https://discourse.nodered.org/u/Sven_Erik)\
**Post date:** [14 April 2022 06:04 UTC](https://discourse.nodered.org/t/split-a-response-from-an-ssh-client/60927/4 "2022-04-14T06:04:51Z")

</div>

Thanks for your answers. Ist works 😁  
Now I have another Problem. I installed boolean for And/ Or functions. „Endlage Tor Zu“ is an Gpio In from my raspberry and it works with my and function but it doesnt matter if i give out an „True“ Or just a „1“ of my function, my and function doesnt Switch through it. There is always an „unknown“ under my function. Can u Tell me whats wrong with my function ?

Edit: msg.plaetze is wrong. Its also msg.payload

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/f/5fecdb2e75d6895302d312d88a72cefb314e8fec.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/f/af89b2305677a223afd09fe855f46f5e8c3dd956.jpeg)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 June 2022 06:05 UTC](https://discourse.nodered.org/t/split-a-response-from-an-ssh-client/60927/5 "2022-06-13T06:05:00Z")

</div>

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