I am attempting to convert a string that I've set up with "Key":"Value" pairs into an array of objects.
What I have currently:
Date:2024-10-02 time,Time:13:13:45,Desc:SSL VPN login fail,IPAddress:95.164.32.58,User:swf group,Group:VPN-USERS-Epicor,Msg:SSL user failed to logged in|Date:Date:2024-10-02 time,Time:13:13:31,Desc:SSL VPN login fail,IPAddress:79.110.62.9,User:Brenton group,Group:VPN-USERS-Epicor,Msg:SSL user failed to logged in|Date:Date:2024-10-02 time,Time:13:11:45,Desc:SSL VPN login fail,IPAddress:45.125.66.55,User:Raquel group,Group:VPN-USERS-Epicor,Msg:SSL user failed to logged in
That is the string, it has 7 "Key":"Value" pairs that repeat many times (Date, Time, Desc, IPAddress, User, Group, Msg). I split this into an array on "|" and get an array like:
"Date:2024-10-02 time,Time:13:13:45,Desc:SSL VPN login fail,IPAddress:95.164.32.58,User:swf group,Group:VPN-USERS-Epicor,Msg:SSL user failed to logged in",
",Date:2024-10-02 time,Time:13:13:31,Desc:SSL VPN login fail,IPAddress:79.110.62.9,User:Brenton group,Group:VPN-USERS-Epicor,Msg:SSL user failed to logged in",
",Date:2024-10-02 time,Time:13:11:45,Desc:SSL VPN login fail,IPAddress:45.125.66.55,User:Raquel group,Group:VPN-USERS-Epicor,Msg:SSL user failed to logged in",
",Date:2024-10-02 time,Time:13:11:21,Desc:SSL VPN login fail,IPAddress:79.110.62.8,User:Oliver group,Group:VPN-USERS-Epicor,Msg:SSL user failed to logged in",
But if I try to put this into another loop, it just keeps running without stopping and never gives me an output.
I've tried replacing all of the "," with "|" and then splitting, but that just makes it a longer array with each "Key":"Value" pair it's own element.
What I am trying to do is to take a bunch of emails from Outlook and pull data out of them, pair that data down to just the 7 parts that I need and then put just that into a table to email back to me so it's possible to evaluate the information. The emails that I'm pulling the data from have anywhere from 10 to 100 lines of data. I only need the 7 parts from each of the lines, so the array would be 7 "Key":"Value" pairs times the 10 to 100 lines in the email. I have everything else working to the point where I've got the above string lined up, I just can't figure out how to get it split into the proper array of objects.
Edit for clarity
This is the expected results that I am trying to get (this is 3 rows worth of data):
[
[
"Date" : "2024-10-02",
"Time" : "13:13:45",
"Desc" : "SSL VPN login fail",
"IPAddress" : "95.164.32.58",
"User" : "swf",
"Group" : "VPN-USERS-Epicor",
"Msg" : "SSL user failed to logged in"
],
[
"Date" : "2024-10-02",
"Time" : "13:13:31",
"Desc" : "SSL VPN login fail",
"IPAddress" : "79.110.62.9",
"User" : "Brenton",
"Group" : "VPN-USERS-Epicor",
"Msg" : "SSL user failed to logged in"
],
[
"Date" : "2024-10-02",
"Time" : "13:11:45",
"Desc" : "SSL VPN login fail",
"IPAddress" : "45.125.66.55",
"User" : "Raquel",
"Group" : "VPN-USERS-Epicor",
"Msg" : "SSL user failed to logged in"
]
]
This way I can use the Create HTML table to make the results into a table for the email.
