# Urgent Help convert syslog to Json

**URL:** <https://discourse.nodered.org/t/urgent-help-convert-syslog-to-json/1081>\
**Category:** General\
**Created:** [25 June 2018 20:02 UTC](https://discourse.nodered.org/t/urgent-help-convert-syslog-to-json/1081 "2018-06-25T20:02:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![javier1991](https://avatars.discourse-cdn.com/v4/letter/j/7ab992/32.png) [@javier1991](https://discourse.nodered.org/u/javier1991)\
**Post date:** [25 June 2018 20:02 UTC](https://discourse.nodered.org/t/urgent-help-convert-syslog-to-json/1081/1 "2018-06-25T20:02:13Z")

</div>

hello i try to see a graffic of temperature recive for one equipment the problem is the equipment only send a syslog messaje it`s posible convert the syslog string to a Json string?

this is the messaje

msg.payload : string[148]  
“\<133\>Jun 25 14:03:00 Node-RED[514]: \<133\>Jun 25 14:01:27 LABORATORIO device :nmr\_read\_temperature: converted temperature: 33.250000”

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [25 June 2018 20:22 UTC](https://discourse.nodered.org/t/urgent-help-convert-syslog-to-json/1081/2 "2018-06-25T20:22:36Z")

</div>

Well it’s already a string… but maybe you want to parse the data out of it ?  
Maybe a clue of how you want it to end up like would help ?

---

<div class="post-metadata">

**Author:** ![javier1991](https://avatars.discourse-cdn.com/v4/letter/j/7ab992/32.png) [@javier1991](https://discourse.nodered.org/u/javier1991)\
**Post date:** [25 June 2018 20:41 UTC](https://discourse.nodered.org/t/urgent-help-convert-syslog-to-json/1081/3 "2018-06-25T20:41:35Z")

</div>

ok the idea is only see that ( converted temperature: 33.250000) to see it in a graphic on the dashboard

---

<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:** [25 June 2018 20:53 UTC](https://discourse.nodered.org/t/urgent-help-convert-syslog-to-json/1081/4 "2018-06-25T20:53:19Z")

</div>

Why is this more urgent than other issues?

There are many different ways of extracting part of a string using javascript. If you look at any of the many javascript tutorials online you will find how to do it.

---

<div class="post-metadata">

**Author:** ![javier1991](https://avatars.discourse-cdn.com/v4/letter/j/7ab992/32.png) [@javier1991](https://discourse.nodered.org/u/javier1991)\
**Post date:** [25 June 2018 20:58 UTC](https://discourse.nodered.org/t/urgent-help-convert-syslog-to-json/1081/5 "2018-06-25T20:58:21Z")

</div>

thanks for your coment is for a school proyect i have 10 years old

---

<div class="post-metadata">

**Author:** ![javier1991](https://avatars.discourse-cdn.com/v4/letter/j/7ab992/32.png) [@javier1991](https://discourse.nodered.org/u/javier1991)\
**Post date:** [26 June 2018 17:37 UTC](https://discourse.nodered.org/t/urgent-help-convert-syslog-to-json/1081/6 "2018-06-26T17:37:44Z")

</div>

msg.payload : array[9]  
array[9]  
0: “\<133\>Jun 26 11”  
1: “31”  
2: “27 L Node-RED[514]”  
3: " \<133\>Jun 26 11"  
4: “29”  
5: “51 LABORATORIO device "  
6: “nmr\_read\_temperature”  
7: " converted temperature”  
8: " 30.250000"  
now have that i only need see the point 8 on array 8: " 30.250000"

---

<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:** [26 June 2018 17:57 UTC](https://discourse.nodered.org/t/urgent-help-convert-syslog-to-json/1081/7 "2018-06-26T17:57:24Z")

</div>

Well since it is an array, you just have to figure out how to get the eight element of the array. Maybe this will help: [https://www.w3schools.com/js/js\_arrays.asp](https://www.w3schools.com/js/js_arrays.asp)
