Hi all.
I've got some json data coming in via a http post. One of the paths I'd like to reference contains a unique ID that changes regularly. Is there any way to somehow reference that still so that I can format and store the data down to a csv?
Hi all.
I've got some json data coming in via a http post. One of the paths I'd like to reference contains a unique ID that changes regularly. Is there any way to somehow reference that still so that I can format and store the data down to a csv?
More than likely yes, however impossible to say without seeing sample data
{
"76561198135379779": {
"name": "♛sztoku♛",
"observer_slot": 1,
"team": "T",
"state": {
"health": 0,
"armor": 0,
"helmet": false,
"flashed": 0,
"burning": 0,
"money": 1250,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 2650
},
"match_stats": {
"kills": 12,
"assists": 3,
"deaths": 12,
"mvps": 1,
"score": 27
},
"weapons": {},
"position": "75.37, -2194.81, -35.97",
"forward": "-0.96, 0.04, 0.29"
},
"76561198070355513": {
"name": "Popularny",
"observer_slot": 2,
"team": "T",
"state": {
"health": 100,
"armor": 100,
"helmet": true,
"flashed": 0,
"burning": 0,
"money": 150,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 3450
},
"match_stats": {
"kills": 16,
"assists": 5,
"deaths": 13,
"mvps": 3,
"score": 38
},
"weapons": {
"weapon_0": {
"name": "weapon_knife_t",
"paintkit": "default",
"type": "Knife",
"state": "holstered"
},
"weapon_1": {
"name": "weapon_glock",
"paintkit": "default",
"type": "Pistol",
"ammo_clip": 20,
"ammo_clip_max": 20,
"ammo_reserve": 120,
"state": "holstered"
},
"weapon_2": {
"name": "weapon_mac10",
"paintkit": "so_red",
"type": "Submachine Gun",
"ammo_clip": 30,
"ammo_clip_max": 30,
"ammo_reserve": 100,
"state": "holstered"
},
"weapon_3": {
"name": "weapon_smokegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "active"
},
"weapon_4": {
"name": "weapon_hegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_5": {
"name": "weapon_flashbang",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_6": {
"name": "weapon_molotov",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
}
},
"position": "413.10, -697.44, -166.73",
"forward": "-0.96, 0.04, 0.29"
},
"76561198072950574": {
"clan": "essasound",
"name": "hawk3r",
"observer_slot": 3,
"team": "T",
"state": {
"health": 100,
"armor": 100,
"helmet": true,
"flashed": 0,
"burning": 0,
"money": 1750,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 2300
},
"match_stats": {
"kills": 11,
"assists": 3,
"deaths": 10,
"mvps": 2,
"score": 25
},
"weapons": {
"weapon_0": {
"name": "weapon_knife_t",
"paintkit": "default",
"type": "Knife",
"state": "holstered"
},
"weapon_1": {
"name": "weapon_p250",
"paintkit": "cu_xray_p250",
"type": "Pistol",
"ammo_clip": 13,
"ammo_clip_max": 13,
"ammo_reserve": 26,
"state": "active"
},
"weapon_2": {
"name": "weapon_smokegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_3": {
"name": "weapon_flashbang",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 2,
"state": "holstered"
},
"weapon_4": {
"name": "weapon_hegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
}
},
"position": "743.97, -1583.10, -257.12",
"forward": "-1.00, -0.01, 0.10"
},
"76561198169271439": {
"name": "Master HedroXXX",
"observer_slot": 4,
"team": "T",
"state": {
"health": 100,
"armor": 100,
"helmet": true,
"flashed": 0,
"burning": 0,
"money": 150,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 57,
"equip_value": 4700
},
"match_stats": {
"kills": 9,
"assists": 1,
"deaths": 7,
"mvps": 2,
"score": 23
},
"weapons": {
"weapon_0": {
"name": "weapon_knife_t",
"paintkit": "default",
"type": "Knife",
"state": "holstered"
},
"weapon_1": {
"name": "weapon_glock",
"paintkit": "default",
"type": "Pistol",
"ammo_clip": 20,
"ammo_clip_max": 20,
"ammo_reserve": 120,
"state": "holstered"
},
"weapon_2": {
"name": "weapon_ak47",
"paintkit": "default",
"type": "Rifle",
"ammo_clip": 23,
"ammo_clip_max": 30,
"ammo_reserve": 90,
"state": "active"
},
"weapon_3": {
"name": "weapon_smokegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_4": {
"name": "weapon_flashbang",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
}
},
"position": "-225.64, -933.94, -167.09",
"forward": "-0.57, 0.82, -0.00"
},
"76561198193177525": {
"name": "HArrick",
"observer_slot": 6,
"team": "CT",
"state": {
"health": 100,
"armor": 100,
"helmet": true,
"flashed": 0,
"burning": 0,
"money": 50,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 2000
},
"match_stats": {
"kills": 5,
"assists": 0,
"deaths": 13,
"mvps": 1,
"score": 17
},
"weapons": {
"weapon_0": {
"name": "weapon_knife",
"paintkit": "default",
"type": "Knife",
"state": "holstered"
},
"weapon_1": {
"name": "weapon_p250",
"paintkit": "default",
"type": "Pistol",
"ammo_clip": 13,
"ammo_clip_max": 13,
"ammo_reserve": 25,
"state": "holstered"
},
"weapon_2": {
"name": "weapon_smokegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "active"
},
"weapon_3": {
"name": "weapon_flashbang",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 2,
"state": "holstered"
}
},
"position": "-1867.16, 537.31, -165.72",
"forward": "0.98, -0.22, 0.04"
},
"76561198167105350": {
"name": "KUBSON",
"observer_slot": 5,
"team": "T",
"state": {
"health": 100,
"armor": 100,
"helmet": true,
"flashed": 0,
"burning": 0,
"money": 0,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 4200
},
"match_stats": {
"kills": 16,
"assists": 1,
"deaths": 8,
"mvps": 3,
"score": 33
},
"weapons": {
"weapon_0": {
"name": "weapon_knife_t",
"paintkit": "default",
"type": "Knife",
"state": "holstered"
},
"weapon_1": {
"name": "weapon_usp_silencer",
"paintkit": "so_whiteout_riptide",
"type": "Pistol",
"ammo_clip": 12,
"ammo_clip_max": 12,
"ammo_reserve": 24,
"state": "holstered"
},
"weapon_2": {
"name": "weapon_ak47",
"paintkit": "default",
"type": "Rifle",
"ammo_clip": 30,
"ammo_clip_max": 30,
"ammo_reserve": 90,
"state": "active"
},
"weapon_3": {
"name": "weapon_hegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
}
},
"position": "231.29, -2347.40, -39.97",
"forward": "-0.80, 0.59, -0.08"
},
"76561198138489847": {
"clan": "JOSKIY.",
"name": "(◕‿◕)",
"observer_slot": 7,
"team": "CT",
"state": {
"health": 100,
"armor": 100,
"helmet": false,
"flashed": 0,
"burning": 0,
"money": 700,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 1350
},
"match_stats": {
"kills": 14,
"assists": 3,
"deaths": 12,
"mvps": 3,
"score": 32
},
"weapons": {
"weapon_0": {
"name": "weapon_knife",
"paintkit": "default",
"type": "Knife",
"state": "holstered"
},
"weapon_1": {
"name": "weapon_deagle",
"paintkit": "aq_desert_eagle_constable",
"type": "Pistol",
"ammo_clip": 7,
"ammo_clip_max": 7,
"ammo_reserve": 35,
"state": "active"
}
},
"position": "-2353.48, 727.00, -39.97",
"forward": "1.00, -0.04, -0.04"
},
"76561198147212016": {
"name": "haps",
"observer_slot": 8,
"team": "CT",
"state": {
"health": 100,
"armor": 100,
"helmet": true,
"flashed": 0,
"burning": 0,
"money": 350,
"round_kills": 1,
"round_killhs": 1,
"round_totaldmg": 100,
"equip_value": 2750
},
"match_stats": {
"kills": 11,
"assists": 2,
"deaths": 13,
"mvps": 0,
"score": 24
},
"weapons": {
"weapon_0": {
"name": "weapon_knife",
"paintkit": "default",
"type": "Knife",
"state": "holstered"
},
"weapon_1": {
"name": "weapon_fiveseven",
"paintkit": "default",
"type": "Pistol",
"ammo_clip": 17,
"ammo_clip_max": 20,
"ammo_reserve": 100,
"state": "active"
},
"weapon_2": {
"name": "weapon_mac10",
"paintkit": "cu_mac10_nacre",
"type": "Submachine Gun",
"ammo_clip": 30,
"ammo_clip_max": 30,
"ammo_reserve": 100,
"state": "holstered"
},
"weapon_3": {
"name": "weapon_flashbang",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
}
},
"position": "39.41, -2140.02, -35.97",
"forward": "0.78, -0.63, 0.04"
},
"76561197978590299": {
"clan": "minecrfat",
"name": "puppaNd",
"observer_slot": 9,
"team": "CT",
"state": {
"health": 100,
"armor": 0,
"helmet": false,
"flashed": 0,
"burning": 0,
"money": 1350,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 700
},
"match_stats": {
"kills": 8,
"assists": 1,
"deaths": 13,
"mvps": 0,
"score": 20
},
"weapons": {
"weapon_0": {
"name": "weapon_knife_karambit",
"paintkit": "so_night",
"type": "Knife",
"state": "holstered"
},
"weapon_1": {
"name": "weapon_deagle",
"paintkit": "so_night",
"type": "Pistol",
"ammo_clip": 7,
"ammo_clip_max": 7,
"ammo_reserve": 35,
"state": "active"
}
},
"position": "-836.29, -2401.37, -168.86",
"forward": "0.71, 0.70, -0.01"
},
"76561197991626640": {
"clan": "maha pöydäl",
"name": "vildeeeN",
"observer_slot": 0,
"team": "CT",
"state": {
"health": 43,
"armor": 0,
"helmet": false,
"flashed": 0,
"burning": 0,
"money": 1600,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 700
},
"match_stats": {
"kills": 12,
"assists": 0,
"deaths": 13,
"mvps": 1,
"score": 27
},
"weapons": {
"weapon_0": {
"name": "weapon_knife_gypsy_jackknife",
"paintkit": "am_zebra",
"type": "Knife",
"state": "holstered"
},
"weapon_1": {
"name": "weapon_deagle",
"paintkit": "cu_deagle_kitch",
"type": "Pistol",
"ammo_clip": 7,
"ammo_clip_max": 7,
"ammo_reserve": 33,
"state": "active"
}
},
"position": "-1291.69, -1158.37, -167.97",
"forward": "0.47, 0.88, -0.06"
}
}
This is a section of the data I'm getting in as a payload. Would like to format it somehow so I can sort by observer slot and store it into two teams.
There is no real need to sort the data (sorting is an expensive operation)
The better solution (IMO) is to have predictable keys so that you can always access it by a known name e.g. msg.payload.slot1
Demo flow...
[{"id":"492ed4c9a614157a","type":"inject","z":"10ece3ab98e93683","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1495,"y":720,"wires":[["3f227ad1b0206f24"]],"l":false},{"id":"3f227ad1b0206f24","type":"change","z":"10ece3ab98e93683","name":"your data","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ \"76561198135379779\": { \"name\": \"♛sztoku♛\", \"observer_slot\": 1, \"team\": \"T\", \"state\": { \"health\": 0, \"armor\": 0, \"helmet\": false, \"flashed\": 0, \"burning\": 0, \"money\": 1250, \"round_kills\": 0, \"round_killhs\": 0, \"round_totaldmg\": 0, \"equip_value\": 2650 }, \"match_stats\": { \"kills\": 12, \"assists\": 3, \"deaths\": 12, \"mvps\": 1, \"score\": 27 }, \"weapons\": {}, \"position\": \"75.37, -2194.81, -35.97\", \"forward\": \"-0.96, 0.04, 0.29\" }, \"76561198070355513\": { \"name\": \"Popularny\", \"observer_slot\": 2, \"team\": \"T\", \"state\": { \"health\": 100, \"armor\": 100, \"helmet\": true, \"flashed\": 0, \"burning\": 0, \"money\": 150, \"round_kills\": 0, \"round_killhs\": 0, \"round_totaldmg\": 0, \"equip_value\": 3450 }, \"match_stats\": { \"kills\": 16, \"assists\": 5, \"deaths\": 13, \"mvps\": 3, \"score\": 38 }, \"weapons\": { \"weapon_0\": { \"name\": \"weapon_knife_t\", \"paintkit\": \"default\", \"type\": \"Knife\", \"state\": \"holstered\" }, \"weapon_1\": { \"name\": \"weapon_glock\", \"paintkit\": \"default\", \"type\": \"Pistol\", \"ammo_clip\": 20, \"ammo_clip_max\": 20, \"ammo_reserve\": 120, \"state\": \"holstered\" }, \"weapon_2\": { \"name\": \"weapon_mac10\", \"paintkit\": \"so_red\", \"type\": \"Submachine Gun\", \"ammo_clip\": 30, \"ammo_clip_max\": 30, \"ammo_reserve\": 100, \"state\": \"holstered\" }, \"weapon_3\": { \"name\": \"weapon_smokegrenade\", \"paintkit\": \"default\", \"type\": \"Grenade\", \"ammo_reserve\": 1, \"state\": \"active\" }, \"weapon_4\": { \"name\": \"weapon_hegrenade\", \"paintkit\": \"default\", \"type\": \"Grenade\", \"ammo_reserve\": 1, \"state\": \"holstered\" }, \"weapon_5\": { \"name\": \"weapon_flashbang\", \"paintkit\": \"default\", \"type\": \"Grenade\", \"ammo_reserve\": 1, \"state\": \"holstered\" }, \"weapon_6\": { \"name\": \"weapon_molotov\", \"paintkit\": \"default\", \"type\": \"Grenade\", \"ammo_reserve\": 1, \"state\": \"holstered\" } }, \"position\": \"413.10, -697.44, -166.73\", \"forward\": \"-0.96, 0.04, 0.29\" }, \"76561198072950574\": { \"clan\": \"essasound\", \"name\": \"hawk3r\", \"observer_slot\": 3, \"team\": \"T\", \"state\": { \"health\": 100, \"armor\": 100, \"helmet\": true, \"flashed\": 0, \"burning\": 0, \"money\": 1750, \"round_kills\": 0, \"round_killhs\": 0, \"round_totaldmg\": 0, \"equip_value\": 2300 }, \"match_stats\": { \"kills\": 11, \"assists\": 3, \"deaths\": 10, \"mvps\": 2, \"score\": 25 }, \"weapons\": { \"weapon_0\": { \"name\": \"weapon_knife_t\", \"paintkit\": \"default\", \"type\": \"Knife\", \"state\": \"holstered\" }, \"weapon_1\": { \"name\": \"weapon_p250\", \"paintkit\": \"cu_xray_p250\", \"type\": \"Pistol\", \"ammo_clip\": 13, \"ammo_clip_max\": 13, \"ammo_reserve\": 26, \"state\": \"active\" }, \"weapon_2\": { \"name\": \"weapon_smokegrenade\", \"paintkit\": \"default\", \"type\": \"Grenade\", \"ammo_reserve\": 1, \"state\": \"holstered\" }, \"weapon_3\": { \"name\": \"weapon_flashbang\", \"paintkit\": \"default\", \"type\": \"Grenade\", \"ammo_reserve\": 2, \"state\": \"holstered\" }, \"weapon_4\": { \"name\": \"weapon_hegrenade\", \"paintkit\": \"default\", \"type\": \"Grenade\", \"ammo_reserve\": 1, \"state\": \"holstered\" } }, \"position\": \"743.97, -1583.10, -257.12\", \"forward\": \"-1.00, -0.01, 0.10\" }, \"76561198169271439\": { \"name\": \"Master HedroXXX\", \"observer_slot\": 4, \"team\": \"T\", \"state\": { \"health\": 100, \"armor\": 100, \"helmet\": true, \"flashed\": 0, \"burning\": 0, \"money\": 150, \"round_kills\": 0, \"round_killhs\": 0, \"round_totaldmg\": 57, \"equip_value\": 4700 }, \"match_stats\": { \"kills\": 9, \"assists\": 1, \"deaths\": 7, \"mvps\": 2, \"score\": 23 }, \"weapons\": { \"weapon_0\": { \"name\": \"weapon_knife_t\", \"paintkit\": \"default\", \"type\": \"Knife\", \"state\": \"holstered\" }, \"weapon_1\": { \"name\": \"weapon_glock\", \"paintkit\": \"default\", \"type\": \"Pistol\", \"ammo_clip\": 20, \"ammo_clip_max\": 20, \"ammo_reserve\": 120, \"state\": \"holstered\" }, \"weapon_2\": { \"name\": \"weapon_ak47\", \"paintkit\": \"default\", \"type\": \"Rifle\", \"ammo_clip\": 23, \"ammo_clip_max\": 30, \"ammo_reserve\": 90, \"state\": \"active\" }, \"weapon_3\": { \"name\": \"weapon_smokegrenade\", \"paintkit\": \"default\", \"type\": \"Grenade\", \"ammo_reserve\": 1, \"state\": \"holstered\" }, \"weapon_4\": { \"name\": \"weapon_flashbang\", \"paintkit\": \"default\", \"type\": \"Grenade\", \"ammo_reserve\": 1, \"state\": \"holstered\" } }, \"position\": \"-225.64, -933.94, -167.09\", \"forward\": \"-0.57, 0.82, -0.00\" }, \"76561198193177525\": { \"name\": \"HArrick\", \"observer_slot\": 6, \"team\": \"CT\", \"state\": { \"health\": 100, \"armor\": 100, \"helmet\": true, \"flashed\": 0, \"burning\": 0, \"money\": 50, \"round_kills\": 0, \"round_killhs\": 0, \"round_totaldmg\": 0, \"equip_value\": 2000 }, \"match_stats\": { \"kills\": 5, \"assists\": 0, \"deaths\": 13, \"mvps\": 1, \"score\": 17 }, \"weapons\": { \"weapon_0\": { \"name\": \"weapon_knife\", \"paintkit\": \"default\", \"type\": \"Knife\", \"state\": \"holstered\" }, \"weapon_1\": { \"name\": \"weapon_p250\", \"paintkit\": \"default\", \"type\": \"Pistol\", \"ammo_clip\": 13, \"ammo_clip_max\": 13, \"ammo_reserve\": 25, \"state\": \"holstered\" }, \"weapon_2\": { \"name\": \"weapon_smokegrenade\", \"paintkit\": \"default\", \"type\": \"Grenade\", \"ammo_reserve\": 1, \"state\": \"active\" }, \"weapon_3\": { \"name\": \"weapon_flashbang\", \"paintkit\": \"default\", \"type\": \"Grenade\", \"ammo_reserve\": 2, \"state\": \"holstered\" } }, \"position\": \"-1867.16, 537.31, -165.72\", \"forward\": \"0.98, -0.22, 0.04\" }, \"76561198167105350\": { \"name\": \"KUBSON\", \"observer_slot\": 5, \"team\": \"T\", \"state\": { \"health\": 100, \"armor\": 100, \"helmet\": true, \"flashed\": 0, \"burning\": 0, \"money\": 0, \"round_kills\": 0, \"round_killhs\": 0, \"round_totaldmg\": 0, \"equip_value\": 4200 }, \"match_stats\": { \"kills\": 16, \"assists\": 1, \"deaths\": 8, \"mvps\": 3, \"score\": 33 }, \"weapons\": { \"weapon_0\": { \"name\": \"weapon_knife_t\", \"paintkit\": \"default\", \"type\": \"Knife\", \"state\": \"holstered\" }, \"weapon_1\": { \"name\": \"weapon_usp_silencer\", \"paintkit\": \"so_whiteout_riptide\", \"type\": \"Pistol\", \"ammo_clip\": 12, \"ammo_clip_max\": 12, \"ammo_reserve\": 24, \"state\": \"holstered\" }, \"weapon_2\": { \"name\": \"weapon_ak47\", \"paintkit\": \"default\", \"type\": \"Rifle\", \"ammo_clip\": 30, \"ammo_clip_max\": 30, \"ammo_reserve\": 90, \"state\": \"active\" }, \"weapon_3\": { \"name\": \"weapon_hegrenade\", \"paintkit\": \"default\", \"type\": \"Grenade\", \"ammo_reserve\": 1, \"state\": \"holstered\" } }, \"position\": \"231.29, -2347.40, -39.97\", \"forward\": \"-0.80, 0.59, -0.08\" }, \"76561198138489847\": { \"clan\": \"JOSKIY.\", \"name\": \"(◕‿◕)\", \"observer_slot\": 7, \"team\": \"CT\", \"state\": { \"health\": 100, \"armor\": 100, \"helmet\": false, \"flashed\": 0, \"burning\": 0, \"money\": 700, \"round_kills\": 0, \"round_killhs\": 0, \"round_totaldmg\": 0, \"equip_value\": 1350 }, \"match_stats\": { \"kills\": 14, \"assists\": 3, \"deaths\": 12, \"mvps\": 3, \"score\": 32 }, \"weapons\": { \"weapon_0\": { \"name\": \"weapon_knife\", \"paintkit\": \"default\", \"type\": \"Knife\", \"state\": \"holstered\" }, \"weapon_1\": { \"name\": \"weapon_deagle\", \"paintkit\": \"aq_desert_eagle_constable\", \"type\": \"Pistol\", \"ammo_clip\": 7, \"ammo_clip_max\": 7, \"ammo_reserve\": 35, \"state\": \"active\" } }, \"position\": \"-2353.48, 727.00, -39.97\", \"forward\": \"1.00, -0.04, -0.04\" }, \"76561198147212016\": { \"name\": \"haps\", \"observer_slot\": 8, \"team\": \"CT\", \"state\": { \"health\": 100, \"armor\": 100, \"helmet\": true, \"flashed\": 0, \"burning\": 0, \"money\": 350, \"round_kills\": 1, \"round_killhs\": 1, \"round_totaldmg\": 100, \"equip_value\": 2750 }, \"match_stats\": { \"kills\": 11, \"assists\": 2, \"deaths\": 13, \"mvps\": 0, \"score\": 24 }, \"weapons\": { \"weapon_0\": { \"name\": \"weapon_knife\", \"paintkit\": \"default\", \"type\": \"Knife\", \"state\": \"holstered\" }, \"weapon_1\": { \"name\": \"weapon_fiveseven\", \"paintkit\": \"default\", \"type\": \"Pistol\", \"ammo_clip\": 17, \"ammo_clip_max\": 20, \"ammo_reserve\": 100, \"state\": \"active\" }, \"weapon_2\": { \"name\": \"weapon_mac10\", \"paintkit\": \"cu_mac10_nacre\", \"type\": \"Submachine Gun\", \"ammo_clip\": 30, \"ammo_clip_max\": 30, \"ammo_reserve\": 100, \"state\": \"holstered\" }, \"weapon_3\": { \"name\": \"weapon_flashbang\", \"paintkit\": \"default\", \"type\": \"Grenade\", \"ammo_reserve\": 1, \"state\": \"holstered\" } }, \"position\": \"39.41, -2140.02, -35.97\", \"forward\": \"0.78, -0.63, 0.04\" }, \"76561197978590299\": { \"clan\": \"minecrfat\", \"name\": \"puppaNd\", \"observer_slot\": 9, \"team\": \"CT\", \"state\": { \"health\": 100, \"armor\": 0, \"helmet\": false, \"flashed\": 0, \"burning\": 0, \"money\": 1350, \"round_kills\": 0, \"round_killhs\": 0, \"round_totaldmg\": 0, \"equip_value\": 700 }, \"match_stats\": { \"kills\": 8, \"assists\": 1, \"deaths\": 13, \"mvps\": 0, \"score\": 20 }, \"weapons\": { \"weapon_0\": { \"name\": \"weapon_knife_karambit\", \"paintkit\": \"so_night\", \"type\": \"Knife\", \"state\": \"holstered\" }, \"weapon_1\": { \"name\": \"weapon_deagle\", \"paintkit\": \"so_night\", \"type\": \"Pistol\", \"ammo_clip\": 7, \"ammo_clip_max\": 7, \"ammo_reserve\": 35, \"state\": \"active\" } }, \"position\": \"-836.29, -2401.37, -168.86\", \"forward\": \"0.71, 0.70, -0.01\" }, \"76561197991626640\": { \"clan\": \"maha pöydäl\", \"name\": \"vildeeeN\", \"observer_slot\": 0, \"team\": \"CT\", \"state\": { \"health\": 43, \"armor\": 0, \"helmet\": false, \"flashed\": 0, \"burning\": 0, \"money\": 1600, \"round_kills\": 0, \"round_killhs\": 0, \"round_totaldmg\": 0, \"equip_value\": 700 }, \"match_stats\": { \"kills\": 12, \"assists\": 0, \"deaths\": 13, \"mvps\": 1, \"score\": 27 }, \"weapons\": { \"weapon_0\": { \"name\": \"weapon_knife_gypsy_jackknife\", \"paintkit\": \"am_zebra\", \"type\": \"Knife\", \"state\": \"holstered\" }, \"weapon_1\": { \"name\": \"weapon_deagle\", \"paintkit\": \"cu_deagle_kitch\", \"type\": \"Pistol\", \"ammo_clip\": 7, \"ammo_clip_max\": 7, \"ammo_reserve\": 33, \"state\": \"active\" } }, \"position\": \"-1291.69, -1158.37, -167.97\", \"forward\": \"0.47, 0.88, -0.06\" } }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1590,"y":720,"wires":[["8431e6031e6c41d7"]]},{"id":"8431e6031e6c41d7","type":"split","z":"10ece3ab98e93683","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":1530,"y":780,"wires":[["f671c633be02e422"]]},{"id":"f38df65e0ba592ab","type":"join","z":"10ece3ab98e93683","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1830,"y":780,"wires":[["7b0b562d1e5d2fae"]]},{"id":"7b0b562d1e5d2fae","type":"debug","z":"10ece3ab98e93683","name":"debug 53","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1820,"y":840,"wires":[]},{"id":"f671c633be02e422","type":"change","z":"10ece3ab98e93683","name":"","rules":[{"t":"set","p":"payload.id","pt":"msg","to":"topic","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"\"slot\" & payload.observer_slot","tot":"jsonata"},{"t":"set","p":"complete","pt":"msg","to":"(parts.index + 1) = parts.count ? true : undefined","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1680,"y":780,"wires":[["f38df65e0ba592ab"]]}]
Thanks for the demo flow.
In an ideal world predictable keys would be ideal but unfortunately the data is set in that format with each player coming in with it's UID as the path and it's sorted by that and not team or observer slot. I tried the flow you provided but just got the following. Only thing I changed was connecting my data to the split node coming in in real time. See below what I got out.
{
"payload": 1,
"_event": "node:863a9f98393fe53e",
"topic": "slot0",
"_msgid": "8bcb0e7ea9a1ca4f",
"req": {
"_readableState": {
"objectMode": false,
"highWaterMark": 16384,
"buffer": {
"head": null,
"tail": null,
"length": 0
},
"length": 0,
"pipes": [],
"flowing": true,
"ended": true,
"endEmitted": true,
"reading": false,
"constructed": true,
"sync": false,
"needReadable": false,
"emittedReadable": false,
"readableListening": false,
"resumeScheduled": false,
"errorEmitted": false,
"emitClose": true,
"autoDestroy": true,
"destroyed": true,
"errored": null,
"closed": true,
"closeEmitted": true,
"defaultEncoding": "utf8",
"awaitDrainWriters": null,
"multiAwaitDrain": false,
"readingMore": false,
"dataEmitted": true,
"decoder": null,
"encoding": null
},
"_events": {},
"_eventsCount": 1,
"socket": "[internal]",
"httpVersionMajor": 1,
"httpVersionMinor": 1,
"httpVersion": "1.1",
"complete": true,
"rawHeaders": [
"user-agent",
"Valve/Steam HTTP Client 1.0 (730)",
"Content-Type",
"application/json",
"Host",
"10.69.69.19:2000",
"Accept",
"text/html,*/*;q=0.9",
"accept-encoding",
"gzip,identity,*;q=0",
"accept-charset",
"ISO-8859-1,utf-8,*;q=0.7",
"Content-Length",
"16429"
],
"rawTrailers": [],
"aborted": false,
"upgrade": false,
"url": "/hud",
"method": "POST",
"statusCode": null,
"statusMessage": null,
"client": "[internal]",
"_consuming": true,
"_dumped": false,
"baseUrl": "",
"originalUrl": "/hud",
"_parsedUrl": {
"protocol": null,
"slashes": null,
"auth": null,
"host": null,
"port": null,
"hostname": null,
"hash": null,
"search": null,
"query": null,
"pathname": "/hud",
"path": "/hud",
"href": "/hud",
"_raw": "/hud"
},
"params": {},
"query": {},
"res": "[internal]",
"body": {
"provider": {
"name": "Counter-Strike: Global Offensive",
"appid": 730,
"version": 13838,
"steamid": "76561198117786044",
"timestamp": 1659689487
},
"map": {
"mode": "competitive",
"name": "de_inferno",
"phase": "live",
"round": 23,
"team_ct": {
"score": 14,
"consecutive_round_losses": 0,
"timeouts_remaining": 1,
"matches_won_this_series": 0
},
"team_t": {
"score": 9,
"consecutive_round_losses": 5,
"timeouts_remaining": 1,
"matches_won_this_series": 0
},
"num_matches_to_win_series": 0,
"current_spectators": 16,
"souvenirs_total": 0
},
"round": {
"phase": "freezetime"
},
"player": {
"steamid": "76561197960280775",
"clan": "NiceiSkeden",
"name": "Thuesen",
"observer_slot": 1,
"team": "T",
"activity": "playing",
"state": {
"health": 100,
"armor": 100,
"helmet": true,
"flashed": 0,
"smoked": 0,
"burning": 0,
"money": 650,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 5100
}
},
"allplayers": {
"76561197960280775": {
"clan": "NiceiSkeden",
"name": "Thuesen",
"observer_slot": 1,
"team": "T",
"state": {
"health": 100,
"armor": 100,
"helmet": true,
"flashed": 0,
"burning": 0,
"money": 650,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 5100
},
"match_stats": {
"kills": 14,
"assists": 2,
"deaths": 19,
"mvps": 2,
"score": 30
},
"weapons": {
"weapon_0": {
"name": "weapon_knife_falchion",
"paintkit": "aq_blued",
"type": "Knife",
"state": "active"
},
"weapon_1": {
"name": "weapon_glock",
"paintkit": "gs_glock18_award",
"type": "Pistol",
"ammo_clip": 20,
"ammo_clip_max": 20,
"ammo_reserve": 120,
"state": "holstered"
},
"weapon_2": {
"name": "weapon_ak47",
"paintkit": "cu_ak47_asiimov",
"type": "Rifle",
"ammo_clip": 30,
"ammo_clip_max": 30,
"ammo_reserve": 90,
"state": "holstered"
},
"weapon_3": {
"name": "weapon_molotov",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_4": {
"name": "weapon_hegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_5": {
"name": "weapon_flashbang",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_6": {
"name": "weapon_smokegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
}
},
"position": "-1657.00, 544.00, -63.14",
"forward": "0.76, -0.65, -0.01"
},
"76561198001283731": {
"name": "jok",
"observer_slot": 6,
"team": "CT",
"state": {
"health": 100,
"armor": 100,
"helmet": true,
"defusekit": true,
"flashed": 0,
"burning": 0,
"money": 10750,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 8150
},
"match_stats": {
"kills": 21,
"assists": 4,
"deaths": 12,
"mvps": 4,
"score": 61
},
"weapons": {
"weapon_0": {
"name": "weapon_knife_survival_bowie",
"paintkit": "am_marked_up_90",
"type": "Knife",
"state": "active"
},
"weapon_1": {
"name": "weapon_deagle",
"paintkit": "cu_desert_eagle_corroden",
"type": "Pistol",
"ammo_clip": 7,
"ammo_clip_max": 7,
"ammo_reserve": 35,
"state": "holstered"
},
"weapon_2": {
"name": "weapon_awp",
"paintkit": "gs_awp_exoskeleton",
"type": "SniperRifle",
"ammo_clip": 10,
"ammo_clip_max": 10,
"ammo_reserve": 30,
"state": "holstered"
},
"weapon_3": {
"name": "weapon_flashbang",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 2,
"state": "holstered"
},
"weapon_4": {
"name": "weapon_smokegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_5": {
"name": "weapon_incgrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
}
},
"position": "2449.14, 2010.22, 128.03",
"forward": "-0.72, 0.69, -0.07"
},
"76561198088661036": {
"clan": "BizonNewMeta",
"name": "[» ᄃΉЯI5-Ø «] ✯",
"observer_slot": 2,
"team": "T",
"state": {
"health": 100,
"armor": 100,
"helmet": true,
"flashed": 0,
"burning": 0,
"money": 150,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 3600
},
"match_stats": {
"kills": 13,
"assists": 6,
"deaths": 19,
"mvps": 1,
"score": 34
},
"weapons": {
"weapon_0": {
"name": "weapon_knife_flip",
"paintkit": "so_purple",
"type": "Knife",
"state": "active"
},
"weapon_1": {
"name": "weapon_glock",
"paintkit": "cu_glock_wasteland_rebel",
"type": "Pistol",
"ammo_clip": 20,
"ammo_clip_max": 20,
"ammo_reserve": 120,
"state": "holstered"
},
"weapon_2": {
"name": "weapon_bizon",
"paintkit": "cu_bizon-osiris",
"type": "Submachine Gun",
"ammo_clip": 64,
"ammo_clip_max": 64,
"ammo_reserve": 120,
"state": "holstered"
},
"weapon_3": {
"name": "weapon_smokegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_4": {
"name": "weapon_hegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_5": {
"name": "weapon_flashbang",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 2,
"state": "holstered"
}
},
"position": "-1531.00, 544.00, -63.34",
"forward": "0.40, -0.92, 0.01"
},
"76561198333914173": {
"name": "kn",
"observer_slot": 7,
"team": "CT",
"state": {
"health": 100,
"armor": 88,
"helmet": true,
"defusekit": true,
"flashed": 0,
"burning": 0,
"money": 6000,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 7650
},
"match_stats": {
"kills": 26,
"assists": 3,
"deaths": 11,
"mvps": 3,
"score": 55
},
"weapons": {
"weapon_0": {
"name": "weapon_knife",
"paintkit": "default",
"type": "Knife",
"state": "active"
},
"weapon_1": {
"name": "weapon_usp_silencer",
"paintkit": "default",
"type": "Pistol",
"ammo_clip": 12,
"ammo_clip_max": 12,
"ammo_reserve": 24,
"state": "holstered"
},
"weapon_2": {
"name": "weapon_awp",
"paintkit": "default",
"type": "SniperRifle",
"ammo_clip": 10,
"ammo_clip_max": 10,
"ammo_reserve": 30,
"state": "holstered"
},
"weapon_3": {
"name": "weapon_incgrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_4": {
"name": "weapon_smokegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_5": {
"name": "weapon_flashbang",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 2,
"state": "holstered"
}
},
"position": "2363.13, 1985.66, 128.03",
"forward": "-0.38, 0.92, -0.09"
},
"76561197982403424": {
"name": "LAx`",
"observer_slot": 8,
"team": "CT",
"state": {
"health": 100,
"armor": 93,
"helmet": true,
"defusekit": true,
"flashed": 0,
"burning": 0,
"money": 12900,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 6100
},
"match_stats": {
"kills": 14,
"assists": 3,
"deaths": 15,
"mvps": 2,
"score": 40
},
"weapons": {
"weapon_0": {
"name": "weapon_knife",
"paintkit": "default",
"type": "Knife",
"state": "holstered"
},
"weapon_1": {
"name": "weapon_fiveseven",
"paintkit": "default",
"type": "Pistol",
"ammo_clip": 20,
"ammo_clip_max": 20,
"ammo_reserve": 100,
"state": "holstered"
},
"weapon_2": {
"name": "weapon_m4a1_silencer",
"paintkit": "default",
"type": "Rifle",
"ammo_clip": 20,
"ammo_clip_max": 20,
"ammo_reserve": 80,
"state": "holstered"
},
"weapon_3": {
"name": "weapon_flashbang",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 2,
"state": "holstered"
},
"weapon_4": {
"name": "weapon_incgrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_5": {
"name": "weapon_hegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "active"
}
},
"position": "2469.79, 2094.25, 132.03",
"forward": "-0.60, -0.80, -0.06"
},
"76561198193177525": {
"name": "HArrick",
"observer_slot": 3,
"team": "T",
"state": {
"health": 100,
"armor": 0,
"helmet": false,
"flashed": 0,
"burning": 0,
"money": 5600,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 200
},
"match_stats": {
"kills": 12,
"assists": 0,
"deaths": 18,
"mvps": 1,
"score": 28
},
"weapons": {
"weapon_0": {
"name": "weapon_knife_t",
"paintkit": "default",
"type": "Knife",
"state": "holstered"
},
"weapon_1": {
"name": "weapon_glock",
"paintkit": "default",
"type": "Pistol",
"ammo_clip": 20,
"ammo_clip_max": 20,
"ammo_reserve": 120,
"state": "active"
}
},
"position": "-1592.00, 688.00, -51.02",
"forward": "0.22, -0.98, -0.01"
},
"76561198979639276": {
"clan": "FUN-WORLD |",
"name": "V[^_^]v",
"observer_slot": 9,
"team": "CT",
"state": {
"health": 100,
"armor": 84,
"helmet": true,
"defusekit": true,
"flashed": 0,
"burning": 0,
"money": 2250,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 6200
},
"match_stats": {
"kills": 23,
"assists": 3,
"deaths": 11,
"mvps": 5,
"score": 56
},
"weapons": {
"weapon_0": {
"name": "weapon_knife",
"paintkit": "default",
"type": "Knife",
"state": "active"
},
"weapon_1": {
"name": "weapon_deagle",
"paintkit": "default",
"type": "Pistol",
"ammo_clip": 7,
"ammo_clip_max": 7,
"ammo_reserve": 35,
"state": "holstered"
},
"weapon_2": {
"name": "weapon_ak47",
"paintkit": "cu_ak47_asiimov",
"type": "Rifle",
"ammo_clip": 30,
"ammo_clip_max": 30,
"ammo_reserve": 90,
"state": "holstered"
},
"weapon_3": {
"name": "weapon_incgrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_4": {
"name": "weapon_smokegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_5": {
"name": "weapon_hegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_6": {
"name": "weapon_flashbang",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
}
},
"position": "2433.62, 2157.41, 128.03",
"forward": "-0.81, 0.59, -0.05"
},
"76561199053339483": {
"name": "STIFLER",
"observer_slot": 4,
"team": "T",
"state": {
"health": 100,
"armor": 100,
"helmet": true,
"flashed": 0,
"burning": 0,
"money": 50,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 6250
},
"match_stats": {
"kills": 11,
"assists": 0,
"deaths": 18,
"mvps": 4,
"score": 28
},
"weapons": {
"weapon_0": {
"name": "weapon_knife_t",
"paintkit": "default",
"type": "Knife",
"state": "active"
},
"weapon_1": {
"name": "weapon_tec9",
"paintkit": "default",
"type": "Pistol",
"ammo_clip": 18,
"ammo_clip_max": 18,
"ammo_reserve": 90,
"state": "holstered"
},
"weapon_2": {
"name": "weapon_c4",
"paintkit": "default",
"type": "C4",
"state": "holstered"
},
"weapon_3": {
"name": "weapon_awp",
"paintkit": "cu_awp_vein",
"type": "SniperRifle",
"ammo_clip": 10,
"ammo_clip_max": 10,
"ammo_reserve": 30,
"state": "holstered"
}
},
"position": "-1662.18, 288.76, -63.22",
"forward": "0.98, -0.14, -0.13"
},
"76561198138489847": {
"clan": "JOSKIY.",
"name": "(◕‿◕)",
"observer_slot": 5,
"team": "T",
"state": {
"health": 100,
"armor": 100,
"helmet": false,
"flashed": 0,
"burning": 0,
"money": 50,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 3550
},
"match_stats": {
"kills": 12,
"assists": 4,
"deaths": 18,
"mvps": 1,
"score": 32
},
"weapons": {
"weapon_0": {
"name": "weapon_knife_t",
"paintkit": "default",
"type": "Knife",
"state": "holstered"
},
"weapon_1": {
"name": "weapon_glock",
"paintkit": "cu_glock_hero",
"type": "Pistol",
"ammo_clip": 20,
"ammo_clip_max": 20,
"ammo_reserve": 120,
"state": "holstered"
},
"weapon_2": {
"name": "weapon_ak47",
"paintkit": "gs_ak47_professional",
"type": "Rifle",
"ammo_clip": 30,
"ammo_clip_max": 30,
"ammo_reserve": 90,
"state": "active"
}
},
"position": "-1612.00, 763.00, -48.97",
"forward": "0.69, -0.73, -0.00"
},
"76561197994634113": {
"name": "nutsnack",
"observer_slot": 0,
"team": "CT",
"state": {
"health": 100,
"armor": 100,
"helmet": true,
"defusekit": true,
"flashed": 0,
"burning": 0,
"money": 1100,
"round_kills": 0,
"round_killhs": 0,
"round_totaldmg": 0,
"equip_value": 7750
},
"match_stats": {
"kills": 6,
"assists": 3,
"deaths": 15,
"mvps": 0,
"score": 20
},
"weapons": {
"weapon_0": {
"name": "weapon_knife",
"paintkit": "default",
"type": "Knife",
"state": "active"
},
"weapon_1": {
"name": "weapon_usp_silencer",
"paintkit": "cu_usps_blueprint",
"type": "Pistol",
"ammo_clip": 12,
"ammo_clip_max": 12,
"ammo_reserve": 24,
"state": "holstered"
},
"weapon_2": {
"name": "weapon_awp",
"paintkit": "default",
"type": "SniperRifle",
"ammo_clip": 10,
"ammo_clip_max": 10,
"ammo_reserve": 30,
"state": "holstered"
},
"weapon_3": {
"name": "weapon_incgrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_4": {
"name": "weapon_smokegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_5": {
"name": "weapon_hegrenade",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
},
"weapon_6": {
"name": "weapon_flashbang",
"paintkit": "default",
"type": "Grenade",
"ammo_reserve": 1,
"state": "holstered"
}
},
"position": "2292.06, 2027.69, 128.03",
"forward": "-0.44, -0.90, -0.04"
}
},
"grenades": {},
"phase_countdowns": {
"phase": "freezetime",
"phase_ends_in": "4.5"
},
"previously": {
"player": {
"steamid": "76561198333914173",
"name": "kn",
"observer_slot": 7,
"team": "CT",
"state": {
"armor": 88,
"defusekit": true,
"money": 6000,
"equip_value": 7650
}
},
"allplayers": {
"76561197960280775": {
"forward": "0.76, -0.64, -0.01"
}
},
"phase_countdowns": {
"phase_ends_in": "4.8"
}
},
"added": {
"player": {
"clan": true
}
},
"auth": {
"token": "Q79v5tcxVQ8u"
}
},
"_body": true,
"route": {
"path": "/hud",
"stack": [
{
"name": "cookieParser",
"keys": [],
"regexp": {
"__enc__": true,
"type": "regexp",
"data": "/^\\/?$/i"
},
"method": "post"
},
{
"name": "httpMiddleware",
"keys": [],
"regexp": {
"__enc__": true,
"type": "regexp",
"data": "/^\\/?$/i"
},
"method": "post"
},
{
"name": "corsHandler",
"keys": [],
"regexp": {
"__enc__": true,
"type": "regexp",
"data": "/^\\/?$/i"
},
"method": "post"
},
{
"name": "metricsHandler",
"keys": [],
"regexp": {
"__enc__": true,
"type": "regexp",
"data": "/^\\/?$/i"
},
"method": "post"
},
{
"name": "jsonParser",
"keys": [],
"regexp": {
"__enc__": true,
"type": "regexp",
"data": "/^\\/?$/i"
},
"method": "post"
},
{
"name": "urlencodedParser",
"keys": [],
"regexp": {
"__enc__": true,
"type": "regexp",
"data": "/^\\/?$/i"
},
"method": "post"
},
{
"name": "multipartParser",
"keys": [],
"regexp": {
"__enc__": true,
"type": "regexp",
"data": "/^\\/?$/i"
},
"method": "post"
},
{
"name": "rawBodyParser",
"keys": [],
"regexp": {
"__enc__": true,
"type": "regexp",
"data": "/^\\/?$/i"
},
"method": "post"
},
{
"name": "<anonymous>",
"keys": [],
"regexp": {
"__enc__": true,
"type": "regexp",
"data": "/^\\/?$/i"
},
"method": "post"
},
{
"name": "<anonymous>",
"keys": [],
"regexp": {
"__enc__": true,
"type": "regexp",
"data": "/^\\/?$/i"
},
"method": "post"
}
],
"methods": {
"post": true
}
},
"cookies": {},
"signedCookies": {}
},
"res": {}
}
The data you 1st provided was not the same structure as in the above.
My guess is you need to use msg.payload.allplayers
as the payload into the split note. (hint, use a change node BEFORE the split to set msg.payload
to the value of msg.payload.allplayers
I actually did place a change node in to filter it down to match the data I initially copied but my debug node was set to complete msg object not msg.payload. Getting the number 1 as a return when I changed that.
Next hurdle for me now is take slot 1-9 and then slot 0 and distilling it down into a csv with 10 rows. I'm able to isolate the state or match stats by using a change node and 30 csv files is doable but hoping there's a better way I'm not thinking of.
That little split and join combo does work a treat tho. Thanks for that, still trying to wrap my brain around how it exactly works.
This is what I've got atm as my flow to dump to csv
[
{
"id": "830d6e2d0fdb1f12",
"type": "change",
"z": "bb15c7ef0d03e07e",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.allplayers",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1300,
"y": 580,
"wires": [
[
"8431e6031e6c41d7"
]
]
},
{
"id": "8431e6031e6c41d7",
"type": "split",
"z": "bb15c7ef0d03e07e",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "topic",
"x": 1450,
"y": 580,
"wires": [
[
"f671c633be02e422"
]
]
},
{
"id": "f671c633be02e422",
"type": "change",
"z": "bb15c7ef0d03e07e",
"name": "",
"rules": [
{
"t": "set",
"p": "payload.id",
"pt": "msg",
"to": "topic",
"tot": "msg"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "\"slot\" & payload.observer_slot",
"tot": "jsonata"
},
{
"t": "set",
"p": "complete",
"pt": "msg",
"to": "(parts.index + 1) = parts.count ? true : undefined",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1600,
"y": 580,
"wires": [
[
"f38df65e0ba592ab"
]
]
},
{
"id": "f38df65e0ba592ab",
"type": "join",
"z": "bb15c7ef0d03e07e",
"name": "",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": true,
"timeout": "",
"count": "",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 1750,
"y": 580,
"wires": [
[
"29e3a023c0c58467"
]
]
},
{
"id": "29e3a023c0c58467",
"type": "change",
"z": "bb15c7ef0d03e07e",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.slot1",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1900,
"y": 580,
"wires": [
[
"44fb11accacbc99d",
"87bfa2b6f489910c"
]
]
},
{
"id": "44fb11accacbc99d",
"type": "debug",
"z": "bb15c7ef0d03e07e",
"name": "OBSlot1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 2380,
"y": 580,
"wires": []
},
{
"id": "3579fb95fed5edfe",
"type": "http in",
"z": "bb15c7ef0d03e07e",
"d": true,
"name": "Data from CSGO",
"url": "hud",
"method": "post",
"upload": false,
"swaggerDoc": "",
"x": 1080,
"y": 580,
"wires": [
[
"b26eb9887c3e82dc",
"830d6e2d0fdb1f12",
"c87d8270aba9ea45"
]
]
},
{
"id": "b26eb9887c3e82dc",
"type": "change",
"z": "bb15c7ef0d03e07e",
"name": "200 OK",
"rules": [
{
"t": "set",
"p": "StatusCode",
"pt": "msg",
"to": "200",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1280,
"y": 540,
"wires": [
[
"8cfdd2a8ecec0b83"
]
]
},
{
"id": "8cfdd2a8ecec0b83",
"type": "http response",
"z": "bb15c7ef0d03e07e",
"name": "Node-Red Response",
"statusCode": "",
"headers": {},
"x": 1460,
"y": 540,
"wires": []
},
{
"id": "7dfa11e5289d51e4",
"type": "file",
"z": "bb15c7ef0d03e07e",
"name": "player1",
"filename": "/users/bwvideo/documents/producer window assets/player1.csv",
"filenameType": "str",
"appendNewline": false,
"createDir": true,
"overwriteFile": "true",
"encoding": "utf8",
"x": 2340,
"y": 540,
"wires": [
[
"9060b5ddc7220725"
]
]
},
{
"id": "87bfa2b6f489910c",
"type": "json",
"z": "bb15c7ef0d03e07e",
"name": "",
"property": "payload",
"action": "obj",
"pretty": false,
"x": 2090,
"y": 540,
"wires": [
[
"a05f5bc36a0e428d"
]
]
},
{
"id": "9060b5ddc7220725",
"type": "debug",
"z": "bb15c7ef0d03e07e",
"name": "OBSlot1",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 2480,
"y": 540,
"wires": []
},
{
"id": "a05f5bc36a0e428d",
"type": "csv",
"z": "bb15c7ef0d03e07e",
"name": "",
"sep": ",",
"hdrin": true,
"hdrout": "none",
"multi": "one",
"ret": "\\n",
"temp": "",
"skip": "0",
"strings": true,
"include_empty_strings": true,
"include_null_values": true,
"x": 2210,
"y": 540,
"wires": [
[
"7dfa11e5289d51e4"
]
]
},
{
"id": "aacd95aa50491fee",
"type": "inject",
"z": "bb15c7ef0d03e07e",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 1015,
"y": 620,
"wires": [
[
"f2f77b5cfe999141"
]
],
"l": false
},
{
"id": "f2f77b5cfe999141",
"type": "change",
"z": "bb15c7ef0d03e07e",
"name": "your data",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"provider\":{\"name\":\"Counter-Strike: Global Offensive\",\"appid\":730,\"version\":13838,\"steamid\":\"76561198117786044\",\"timestamp\":1660123410},\"map\":{\"mode\":\"competitive\",\"name\":\"de_dust2\",\"phase\":\"live\",\"round\":22,\"team_ct\":{\"score\":13,\"consecutive_round_losses\":2,\"timeouts_remaining\":1,\"matches_won_this_series\":0},\"team_t\":{\"score\":9,\"consecutive_round_losses\":2,\"timeouts_remaining\":1,\"matches_won_this_series\":0},\"num_matches_to_win_series\":0,\"current_spectators\":29,\"souvenirs_total\":0},\"round\":{\"phase\":\"live\"},\"player\":{\"steamid\":\"76561198164060916\",\"clan\":\"ebu_hohlov |\",\"name\":\"uNoTreShh\",\"observer_slot\":2,\"team\":\"T\",\"activity\":\"playing\",\"state\":{\"health\":56,\"armor\":98,\"helmet\":true,\"flashed\":0,\"smoked\":0,\"burning\":0,\"money\":1050,\"round_kills\":2,\"round_killhs\":1,\"round_totaldmg\":113,\"equip_value\":3900}},\"allplayers\":{\"76561198852024163\":{\"clan\":\"0.9kd tаlent\",\"name\":\"nevərmôrℯ\",\"observer_slot\":1,\"team\":\"T\",\"state\":{\"health\":0,\"armor\":0,\"helmet\":false,\"flashed\":0,\"burning\":0,\"money\":7050,\"round_kills\":0,\"round_killhs\":0,\"round_totaldmg\":0,\"equip_value\":5100},\"match_stats\":{\"kills\":20,\"assists\":0,\"deaths\":15,\"mvps\":3,\"score\":40},\"weapons\":{},\"position\":\"348.47, 1476.93, 1.08\",\"forward\":\"-0.92, 0.39, 0.00\"},\"76561197972026266\":{\"name\":\"gstaR\",\"observer_slot\":6,\"team\":\"CT\",\"state\":{\"health\":0,\"armor\":0,\"helmet\":false,\"flashed\":0,\"burning\":0,\"money\":2250,\"round_kills\":1,\"round_killhs\":1,\"round_totaldmg\":100,\"equip_value\":700},\"match_stats\":{\"kills\":21,\"assists\":3,\"deaths\":19,\"mvps\":4,\"score\":54},\"weapons\":{},\"position\":\"429.15, 1749.49, 4.00\",\"forward\":\"0.85, -0.44, -0.27\"},\"76561198210005508\":{\"name\":\"killzon_77\",\"observer_slot\":7,\"team\":\"CT\",\"state\":{\"health\":0,\"armor\":0,\"helmet\":false,\"flashed\":0,\"burning\":0,\"money\":3250,\"round_kills\":1,\"round_killhs\":1,\"round_totaldmg\":92,\"equip_value\":1000},\"match_stats\":{\"kills\":16,\"assists\":7,\"deaths\":15,\"mvps\":0,\"score\":41},\"weapons\":{},\"position\":\"-2090.61, 1826.72, 14.10\",\"forward\":\"0.86, -0.44, -0.27\"},\"76561198164060916\":{\"clan\":\"ebu_hohlov |\",\"name\":\"uNoTreShh\",\"observer_slot\":2,\"team\":\"T\",\"state\":{\"health\":56,\"armor\":98,\"helmet\":true,\"flashed\":0,\"burning\":0,\"money\":1050,\"round_kills\":2,\"round_killhs\":1,\"round_totaldmg\":113,\"equip_value\":3900},\"match_stats\":{\"kills\":11,\"assists\":6,\"deaths\":18,\"mvps\":1,\"score\":28},\"weapons\":{\"weapon_0\":{\"name\":\"weapon_knife_t\",\"paintkit\":\"default\",\"type\":\"Knife\",\"state\":\"holstered\"},\"weapon_1\":{\"name\":\"weapon_glock\",\"paintkit\":\"gs_glock18_award\",\"type\":\"Pistol\",\"ammo_clip\":20,\"ammo_clip_max\":20,\"ammo_reserve\":120,\"state\":\"holstered\"},\"weapon_2\":{\"name\":\"weapon_ak47\",\"paintkit\":\"cu_ak47_aztec\",\"type\":\"Rifle\",\"ammo_clip\":19,\"ammo_clip_max\":30,\"ammo_reserve\":90,\"state\":\"active\"}},\"position\":\"-1134.85, 2584.85, 56.33\",\"forward\":\"-0.89, 0.44, 0.15\"},\"76561198092345874\":{\"name\":\"XARAKTER.\",\"observer_slot\":3,\"team\":\"T\",\"state\":{\"health\":92,\"armor\":100,\"helmet\":true,\"flashed\":0,\"burning\":0,\"money\":2950,\"round_kills\":2,\"round_killhs\":1,\"round_totaldmg\":147,\"equip_value\":5100},\"match_stats\":{\"kills\":15,\"assists\":3,\"deaths\":16,\"mvps\":0,\"score\":33},\"weapons\":{\"weapon_0\":{\"name\":\"weapon_knife_t\",\"paintkit\":\"default\",\"type\":\"Knife\",\"state\":\"holstered\"},\"weapon_1\":{\"name\":\"weapon_deagle\",\"paintkit\":\"cu_deagle_replica\",\"type\":\"Pistol\",\"ammo_clip\":7,\"ammo_clip_max\":7,\"ammo_reserve\":35,\"state\":\"holstered\"},\"weapon_2\":{\"name\":\"weapon_molotov\",\"paintkit\":\"default\",\"type\":\"Grenade\",\"ammo_reserve\":1,\"state\":\"holstered\"},\"weapon_3\":{\"name\":\"weapon_hegrenade\",\"paintkit\":\"default\",\"type\":\"Grenade\",\"ammo_reserve\":1,\"state\":\"holstered\"},\"weapon_4\":{\"name\":\"weapon_ak47\",\"paintkit\":\"gs_ak47_professional\",\"type\":\"Rifle\",\"ammo_clip\":17,\"ammo_clip_max\":30,\"ammo_reserve\":90,\"state\":\"active\"}},\"position\":\"218.52, 2249.68, -86.16\",\"forward\":\"-0.99, 0.15, -0.01\"},\"76561198150582838\":{\"name\":\"paNda!\",\"observer_slot\":8,\"team\":\"CT\",\"state\":{\"health\":100,\"armor\":0,\"helmet\":false,\"flashed\":0,\"burning\":0,\"money\":3500,\"round_kills\":0,\"round_killhs\":0,\"round_totaldmg\":44,\"equip_value\":700},\"match_stats\":{\"kills\":15,\"assists\":7,\"deaths\":11,\"mvps\":4,\"score\":47},\"weapons\":{\"weapon_0\":{\"name\":\"weapon_knife\",\"paintkit\":\"default\",\"type\":\"Knife\",\"state\":\"holstered\"},\"weapon_1\":{\"name\":\"weapon_deagle\",\"paintkit\":\"so_night\",\"type\":\"Pistol\",\"ammo_clip\":5,\"ammo_clip_max\":7,\"ammo_reserve\":31,\"state\":\"active\"}},\"position\":\"-1406.08, 2679.87, 125.03\",\"forward\":\"0.87, -0.41, -0.29\"},\"76561198230350632\":{\"name\":\"♡Romashka\",\"observer_slot\":9,\"team\":\"CT\",\"state\":{\"health\":0,\"armor\":0,\"helmet\":false,\"flashed\":0,\"burning\":0,\"money\":1900,\"round_kills\":0,\"round_killhs\":0,\"round_totaldmg\":0,\"equip_value\":1350},\"match_stats\":{\"kills\":13,\"assists\":2,\"deaths\":14,\"mvps\":1,\"score\":30},\"weapons\":{},\"position\":\"-54.17, 1540.05, 1.00\",\"forward\":\"0.85, -0.44, -0.28\"},\"76561198892315237\":{\"name\":\"E-Erzu\",\"observer_slot\":4,\"team\":\"T\",\"state\":{\"health\":0,\"armor\":0,\"helmet\":false,\"flashed\":0,\"burning\":0,\"money\":1100,\"round_kills\":0,\"round_killhs\":0,\"round_totaldmg\":87,\"equip_value\":2450},\"match_stats\":{\"kills\":12,\"assists\":3,\"deaths\":19,\"mvps\":2,\"score\":27},\"weapons\":{},\"position\":\"-1135.95, 2313.52, 4.94\",\"forward\":\"-0.86, 0.51, 0.05\"},\"76561198282421861\":{\"name\":\"SHRONK\",\"observer_slot\":5,\"team\":\"T\",\"state\":{\"health\":100,\"armor\":100,\"helmet\":true,\"flashed\":0,\"burning\":0,\"money\":2500,\"round_kills\":0,\"round_killhs\":0,\"round_totaldmg\":53,\"equip_value\":5500},\"match_stats\":{\"kills\":14,\"assists\":6,\"deaths\":15,\"mvps\":3,\"score\":34},\"weapons\":{\"weapon_0\":{\"name\":\"weapon_knife_t\",\"paintkit\":\"default\",\"type\":\"Knife\",\"state\":\"holstered\"},\"weapon_1\":{\"name\":\"weapon_m4a1_silencer\",\"paintkit\":\"default\",\"type\":\"Rifle\",\"ammo_clip\":20,\"ammo_clip_max\":20,\"ammo_reserve\":80,\"state\":\"holstered\"},\"weapon_2\":{\"name\":\"weapon_flashbang\",\"paintkit\":\"default\",\"type\":\"Grenade\",\"ammo_reserve\":1,\"state\":\"holstered\"},\"weapon_3\":{\"name\":\"weapon_deagle\",\"paintkit\":\"default\",\"type\":\"Pistol\",\"ammo_clip\":7,\"ammo_clip_max\":7,\"ammo_reserve\":35,\"state\":\"holstered\"},\"weapon_4\":{\"name\":\"weapon_c4\",\"paintkit\":\"default\",\"type\":\"C4\",\"state\":\"active\"},\"weapon_5\":{\"name\":\"weapon_smokegrenade\",\"paintkit\":\"default\",\"type\":\"Grenade\",\"ammo_reserve\":1,\"state\":\"holstered\"}},\"position\":\"976.42, 2556.53, 95.90\",\"forward\":\"0.98, -0.10, -0.17\"},\"76561198838092447\":{\"clan\":\"nt dog\",\"name\":\"Pitt\",\"observer_slot\":0,\"team\":\"CT\",\"state\":{\"health\":0,\"armor\":0,\"helmet\":false,\"flashed\":0,\"burning\":0,\"money\":4100,\"round_kills\":0,\"round_killhs\":0,\"round_totaldmg\":0,\"equip_value\":700},\"match_stats\":{\"kills\":16,\"assists\":3,\"deaths\":15,\"mvps\":4,\"score\":41},\"weapons\":{},\"position\":\"1134.81, 2718.02, 96.33\",\"forward\":\"0.85, -0.44, -0.27\"}},\"grenades\":{},\"phase_countdowns\":{\"phase\":\"live\",\"phase_ends_in\":\"60.1\"},\"previously\":{\"player\":{\"state\":{\"health\":100,\"armor\":100}},\"allplayers\":{\"76561198852024163\":{\"forward\":\"-0.97, 0.25, 0.03\"},\"76561197972026266\":{\"forward\":\"0.86, -0.45, -0.25\"},\"76561198210005508\":{\"forward\":\"0.86, -0.45, -0.25\"},\"76561198164060916\":{\"state\":{\"health\":100,\"armor\":100},\"weapons\":{\"weapon_2\":{\"ammo_clip\":21}},\"position\":\"-1132.67, 2565.91, 50.51\",\"forward\":\"-0.92, 0.39, 0.01\"},\"76561198092345874\":{\"weapons\":{\"weapon_0\":{\"state\":\"active\"},\"weapon_4\":{\"state\":\"holstered\"}},\"position\":\"286.60, 2231.31, -127.75\",\"forward\":\"-0.94, 0.33, -0.03\"},\"76561198150582838\":{\"state\":{\"round_totaldmg\":0},\"weapons\":{\"weapon_1\":{\"ammo_clip\":6}},\"position\":\"-1393.56, 2703.71, 125.03\",\"forward\":\"0.85, -0.44, -0.29\"},\"76561198230350632\":{\"forward\":\"0.86, -0.45, -0.25\"},\"76561198892315237\":{\"forward\":\"-0.90, 0.43, 0.03\"},\"76561198282421861\":{\"position\":\"907.70, 2564.30, 95.40\",\"forward\":\"0.92, -0.35, -0.16\"},\"76561198838092447\":{\"forward\":\"0.86, -0.44, -0.25\"}},\"phase_countdowns\":{\"phase_ends_in\":\"60.4\"}},\"auth\":{\"token\":\"Q79v5tcxVQ8u\"}}",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1110,
"y": 620,
"wires": [
[
"830d6e2d0fdb1f12"
]
]
},
{
"id": "c87d8270aba9ea45",
"type": "debug",
"z": "bb15c7ef0d03e07e",
"name": "Debug",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1270,
"y": 500,
"wires": []
}
]
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.