This helped perfectly. Thanks a lot.
To give someting back here my solution to find out the active default route
In Mikrotik: Add a log action (type=remote) with ip destination from a host, where NodeRED is running. Use Option BSD Syslog. I used Port 20514
Add a log rule to send all "route" logs to the new log action. Then you are done on the mikrotik.
In NodeRED this flow will extract the comment of the active route, when it changes:
[
{
"id": "743ea3c6.a7384c",
"type": "tab",
"label": "Mikrotik active Route",
"disabled": false,
"info": ""
},
{
"id": "2ee0f510.7df702",
"type": "syslog-input",
"z": "743ea3c6.a7384c",
"name": "syslog",
"socktype": "udp",
"address": "",
"port": 20514,
"topic": "",
"x": 360,
"y": 300,
"wires": [
[
"b980ea19.91ba28"
]
]
},
{
"id": "7ed62eb5.61b06",
"type": "debug",
"z": "743ea3c6.a7384c",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1030,
"y": 300,
"wires": []
},
{
"id": "b980ea19.91ba28",
"type": "join",
"z": "743ea3c6.a7384c",
"name": "",
"mode": "custom",
"build": "array",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "1",
"count": "",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "num",
"reduceFixup": "",
"x": 630,
"y": 300,
"wires": [
[
"1e1a90cb.979067"
]
]
},
{
"id": "1e1a90cb.979067",
"type": "function",
"z": "743ea3c6.a7384c",
"name": "",
"func": "var state = 0;\nvar ret= {\"payload\": undefined};\n\nmsg.payload.forEach(function(element,index){\n switch (state) {\n case 0:\n if (element.msg == \"Select route\"){\n state++;\n }\n break;\n case 1:\n if (element.msg.includes(\"comment\")){\n state++;\n ret.payload = element.msg.trim().replace(\"comment=\", \"\");\n }\n break;\n }\n});\nreturn ret;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 640,
"y": 380,
"wires": [
[
"7ed62eb5.61b06"
]
]
}
]