Log Reading

Hey,
I am a newbie in PowerShell and wanted some help in reading a log file and getting the output to a CSV.
Requirement is to get the below details from the bad log entry.

  1. deviceID
  2. Userid
  3. Error details can be the complete text from the log.
  4. if I have an error for the same device we should skip it not collect it. (the deviceid and userId should be unique)
Bad Log entry LOG[Validation Phase 1 finished with status True.]LOG]!><time="12:35:12.6914610" date="8-23-2017" component="CertificateRegistrationPoint" context="" type="1" thread="85" file="

Good Log entry

G[Validation Phase 1 started.]LOG]!><time="12:35:58.8397025" date="8-23-2017" component="CertificateRegistrationPoint" context="" type="1" thread="25" file="

Bad Log entry

LOG[Validation Phase 1 finished with status True.]LOG]!><time="12:35:58.8397025" date="8-23-2017" component="CertificateRegistrationPoint" context="" type="1" thread="25" file="