Logging requester host is empty
So in the Logging page for a given service, I set my logging format to be
%t %h %{req.http.host}i %U "%q" %>s %{time.elapsed.msec}V %b %a "%{referer}i" "%{user-agent}i" %{regsuball(req.body, "\\n+", " ")}V
I am interested in logging the incoming request's host (which domain they used to get to the Fastly service, since there can be multiple domains associated with a service), so that should be req.http.host. However, when I checked the logs, it was empty. Did anyone come across this problem?
-
Hi Bao,
Thank you for posting on the community forums. Please log this instead in order to log the host value used/created by Fastly:
%{req.http.host}V
Otherwise you can log this instead:
%{Host}i
Here's some docs that might be useful:
https://docs.fastly.com/en/guides/custom-log-formats
https://docs.fastly.com/en/guides/useful-variables-to-log
Please sign in to leave a comment.
Comments
1 comment