Hey Brains Trust,
I'm trying to do some stats for paging decoder
I used a tcp to receive the JSON data from paging system
I separate the data into Address, Alias and Agency & timestamp
I would like to graph or get stats on how many times an Address gets paged (Per Day to start with) and then use the Alias to display who that address belongs too.
Im having trouble figuring out how to count because the address is unknown and is 7 digits long.
See below my current flow
[
{
"id": "71e1ac58ae8f5785",
"type": "tab",
"label": "Sonic - Pagermon Stats",
"disabled": false,
"info": "",
"env": []
},
{
"id": "32f80a696d199e73",
"type": "tcp in",
"z": "71e1ac58ae8f5785",
"name": "",
"server": "server",
"host": "",
"port": "8080",
"datamode": "stream",
"datatype": "buffer",
"newline": "100000",
"topic": "",
"trim": false,
"base64": false,
"tls": "",
"x": 120,
"y": 80,
"wires": [
[
"6cddd30e35d3aced"
]
]
},
{
"id": "24debaee2abee42a",
"type": "debug",
"z": "71e1ac58ae8f5785",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1010,
"y": 60,
"wires": []
},
{
"id": "d3ee32429f9c84e6",
"type": "json",
"z": "71e1ac58ae8f5785",
"name": "Convert To Json",
"property": "payload",
"action": "obj",
"pretty": true,
"x": 420,
"y": 80,
"wires": [
[
"24debaee2abee42a",
"b69d5f171bbe7e6f",
"3c5796d8f5a90fc5"
]
]
},
{
"id": "6cddd30e35d3aced",
"type": "function",
"z": "71e1ac58ae8f5785",
"name": "Clean TCP Packet",
"func": "msg.payload = msg.payload.toString('utf8');\nlet body_end = msg.payload.search(\"\\r\\n\\r\\n\");\nlet body = msg.payload.slice(body_end, msg.payload.length);\nmsg.payload=body\nreturn msg",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 170,
"y": 160,
"wires": [
[
"a5536a1799d369d6",
"d3ee32429f9c84e6"
]
]
},
{
"id": "81bfbe3ca6b242a8",
"type": "function",
"z": "71e1ac58ae8f5785",
"name": "Get Agency",
"func": "msg.payload = msg.payload.agency\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 650,
"y": 280,
"wires": [
[
"b435fa510a54b22b"
]
]
},
{
"id": "b435fa510a54b22b",
"type": "debug",
"z": "71e1ac58ae8f5785",
"name": "debug 1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1060,
"y": 140,
"wires": []
},
{
"id": "a5536a1799d369d6",
"type": "debug",
"z": "71e1ac58ae8f5785",
"name": "debug 2",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 120,
"y": 260,
"wires": []
},
{
"id": "5157af30f56cac22",
"type": "function",
"z": "71e1ac58ae8f5785",
"name": "Get TimeStamp",
"func": "msg.payload = msg.payload.timestamp\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 660,
"y": 140,
"wires": [
[
"b435fa510a54b22b"
]
]
},
{
"id": "9234fb2b2bf1944d",
"type": "function",
"z": "71e1ac58ae8f5785",
"name": "Get Alias",
"func": "msg.payload = msg.payload.alias\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 640,
"y": 180,
"wires": [
[
"b435fa510a54b22b"
]
]
},
{
"id": "b69d5f171bbe7e6f",
"type": "deduplicate",
"z": "71e1ac58ae8f5785",
"name": "Filter Duplicates for 1 Second",
"keyproperty": "",
"expiry": "1",
"x": 390,
"y": 260,
"wires": [
[
"5157af30f56cac22",
"9234fb2b2bf1944d",
"81bfbe3ca6b242a8",
"9fd4e4625955af85"
],
[]
],
"inputLabels": [
"Eingang"
],
"outputLabels": [
"Einmal",
"Duplikat"
]
},
{
"id": "3c5796d8f5a90fc5",
"type": "debug",
"z": "71e1ac58ae8f5785",
"name": "debug 4",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 620,
"y": 40,
"wires": []
},
{
"id": "9fd4e4625955af85",
"type": "function",
"z": "71e1ac58ae8f5785",
"name": "Get Address",
"func": "msg.payload = msg.payload.address\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 650,
"y": 220,
"wires": [
[
"b435fa510a54b22b"
]
]
}
]
Any wisdom to help me achieve this
Thanks
Sonic