Azure Log CSV To Plain
Use this skill when a user gives you the path to an Azure-exported CSV log file and wants it rewritten
into a normal line-oriented log file with a .log extension.
Expected Input
The user should provide a file path.
Typical source shape:
- Header row with
"TimeGenerated [UTC]",LogEntry - Each following line starts with a quoted timestamp column
- The actual log message is wrapped as the second CSV field
- Embedded quotes inside the log message are doubled as
""
Workflow
- Read a small sample from the file to confirm it matches the Azure CSV export pattern.
- Rewrite the file in place by:
- removing the CSV header row
- removing the first CSV column and outer CSV quoting
- converting doubled quotes
""back to normal" - pretty-printing valid inline JSON payloads using standard multi-line JSON formatting
- Rename the converted file so the output ends with
.log. - Validate by reading the first few lines and confirming they are plain log entries with no CSV header.
Command
Run the bundled script with the file path the user provided:
perl /Users/<username>/.agents/skills/azure-log-csv-to-plain/azure_csv_logs_to_plain.pl "/path/to/query_data.csv"
The script rewrites the content and renames the result to /path/to/query_data.log.
Validation
- The first line should now begin with the real log content, not
"TimeGenerated [UTC]",LogEntry - Lines should no longer start with the exported timestamp column
- JSON fragments inside log messages should use normal quotes instead of doubled CSV quotes
- Inline JSON payloads should be expanded across multiple lines with indentation
- The converted file should now have a
.logextension
Notes
- This rewrites the content and renames the result to a
.logfile in the same directory. - If the file does not match the expected export pattern, stop and tell the user instead of forcing the conversion.