What functions would you use to clean inconsistent log file data in Excel?
Translate this cleaning task into PostgreSQL. Normalize whitespace, capitalization, blank values, event labels, timestamps, and source codes, while identifying rows that need review.
log_id ascending.log_id, source_name, cleaned_event_type, cleaned_user_id, cleaned_event_at, cleaned_message, and data_quality_status.CLEAN when required cleaned fields and the source match are valid; otherwise use REVIEW.| Column | Type | Description |
|---|---|---|
| log_idPK | INT | Unique raw log identifier |
| source_code | VARCHAR(20) | Raw system source code |
| event_type | VARCHAR(100) | Raw event label |
| user_id | VARCHAR(50) | Raw user identifier |
| raw_timestamp | VARCHAR(40) | Timestamp stored as raw text |
| message | TEXT | Raw log message |
| Column | Type | Description |
|---|---|---|
| source_codePK | VARCHAR(20) | Canonical system source code |
| source_name | VARCHAR(100) | Readable system source name |