Urgent Help convert syslog to Json

#1

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”

0 Likes

#2

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 ?

0 Likes

#3

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

0 Likes

#4

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.

0 Likes

#5

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

0 Likes

#6

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"

0 Likes

#7

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

0 Likes