Problem/Motivation

The module currently only accepts .log and .txt files containing raw Apache combined log format. Acquia Log Explorer exports logs as CSV files with pre-parsed columns (client_ip, method, status_code, url, user_agent, bytes_sent, etc.). Users must manually convert CSV exports or extract the raw log from the body column before uploading.

Steps to reproduce

1. Export access logs from Acquia Log Explorer as CSV
2. Try to upload the .csv file at /admin/reports/apache-access
3. File is rejected (extension not allowed)

Proposed resolution

- Accept .csv files alongside .log and .txt
- Detect CSV format by file extension
- Parse CSV using fgetcsv() to handle quoted fields with embedded newlines
- Map CSV columns directly to report dimensions (client_ip, method, status_code, url, user_agent, bytes_sent, forwarded_for, _messagetime)
- Fall back to parsing the body column (raw Apache log) when direct columns are missing

Remaining tasks

- Review and testing
- Consider supporting additional CSV column name variations

User interface changes

Upload form description updated to mention .csv files.

API changes

None.

Data model changes

New `is_csv` column added to `ip_analyser_report` table (tinyint, default 0).

Comments

sahil.goyal created an issue.