Yeah that’s indeed a way to do it, but it’s the flow card emulator.
For Severity and Facility you ought to use these numbers:
// Facility: 0 kernel, 1 user, 2 mail, 3 system, 4 authorisation, 5 syslog,
/// 6 LPR, 7 News, 8 UUCP, 9 Cron, 10 Deamon, 11 FTP, 12 NTP,
/// 13 Security, 14 Console, 15 Clock, 16 Flow, 17 Device,
/// 18 App, 19 Scene, 20 Trigger, 21 Condition, 22 Action
// Severity: Emergency=0 Alert=1 Critical=2 Error=3 Warning=4 Notice=5 Informational=6 Debug=7
I’m also trying to write to the logs, by using
PUT api/app/nl.nielsdeklerk.log/addlog
but all i got is errors too (@Arie_J_Godschalk : what’s the secret to PUT logs per API please?)
I got:
‘unauthorized’
or
Promise { <pending> }
or
Promise { <rejected> TypeError: Only absolute URLs are supported
Script trial:
//const URL = "https://192-168-1-7.homeylocal.com/api/app/nl.nielsdeklerk.log/addlog";
const URL = "http://192.168.1.7/api/app/nl.nielsdeklerk.log/addlog";
//const URL = "/api/app/nl.nielsdeklerk.log/addlog";
const myLogData = {
'log':'Test 1,2,3',
'group':'TEST',
'facility':18,
'severity':6
};
await fetch(URL,{
method: 'PUT',
headers: {
'Content-Type':'application/json'
},
mode: 'no-cors',
body: JSON.stringify(myLogData)
});
return true;