I need some help with formatting json data. I'm converting a table to json to be ingested into a log collector. The collector only likes json in single line format. How can I convert this json:
[
{ "Severity": "Informational",
"Type": "Milestone",
"SiteCode": "ABC",
"DateTime": 1505840220813,
"System": "Server.domain.local",
"Component": "SMS_Distribution_Point_Monitoring",
"Module": "SMS Server",
"MessageID": 2380,
"Description": "Start to evaluate package ABC001F5 on distribution point Display=\\\\Server.domain.local\\ MSWNET: SMS_SITE=ABC \\\\Server.domain.local\\."
},
{ "Severity": "Informational",
"Type": "Milestone",
"SiteCode": "ABC",
"DateTime": 1505840220787,
"System": "Server.domain.local",
"Component": "SMS_Distribution_Point_Monitoring",
"Module": "SMS Server",
"MessageID": 2384,
"Description": "Package ABC0019F on distribution point Display=\\\\Server.domain.local\\ MSWNET: SMS_SITE=ABC \\\\Server.domain.local\\ has been verified successfully."
}
]
to this in powershell when outputting to a file:
[{"Severity":"Informational","Type":"Milestone","SiteCode":"ABC","DateTime":1505840220813,"System":"Server.thecarlylegroup.local","Component":"SMS_Distribution_Point_Monitoring","Module":"SMSServer","MessageID":2380,"Description":"StarttoevaluatepackageABC001F5ondistributionpointDisplay=\\\\Server.thecarlylegroup.local\\MSWNET:SMS_SITE=ABC\\\\Server.thecarlylegroup.local\\."},
{"Severity":"Informational","Type":"Milestone","SiteCode":"ABC","DateTime":1505840220787,"System":"Server.thecarlylegroup.local","Component":"SMS_Distribution_Point_Monitoring","Module":"SMSServer","MessageID":2384,"Description":"PackageABC0019FondistributionpointDisplay=\\\\Server.thecarlylegroup.local\\MSWNET:SMS_SITE=ABC\\\\Server.thecarlylegroup.local\\hasbeenverifiedsuccessfully."}]