i.e. when user hit “Download as CSV file” or “Download as Excel file”

I’ve checked the webserver logs, it doesn’t show the user name, but only the GET request

[2020-01-27 05:12:17,173][PID:15][INFO][metrics] method=GET path=/api/queries/3270/results.csv endpoint=query_result status=200 content_type=text/csv; charset=UTF-8 content_length=57619 duration=133.85 query_count=11 query_duration=25.70

No, the download event is not logged specifically. You can confirm this by checking Redash’s internal events table.

It should be logged, as a security measure :thinking:

We’d certainly review a PR for this :wink:

@jesse We have a need for this as part of our SIEM efforts, would it be as simple as logging request.remote_user here: redash/request.py at master · getredash/redash · GitHub

I could take a stab at opening a pull request

No. You’d just add a call to record_event in this handler when a user downloads a file. Keep in mind this records a file download only. If a user accesses a query (which emits a “View Query” event) they could still download the entire dataset by copying the XHR request payload from their browser inspection tools.

@k4s1m can you expand on how this record_event would be implemented within the handler you linked? Would this need to be created only when filetype != json?