empty user-agent and logs

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

empty user-agent and logs

Christos Chatzaras

and


are logged with:

xxx.xxx.xxx.xxx - - [14/Sep/2017:22:47:09 +0300] "GET /index.php HTTP/1.1" 200 26039 "-" "-"

There is not difference if there is an empty user-agent or a user-agent with a dash.

Any idea it shows the empty user agents with dash?

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: empty user-agent and logs

Francis Daly
On Thu, Sep 14, 2017 at 10:57:39PM +0300, Christos Chatzaras wrote:

Hi there,

> xxx.xxx.xxx.xxx - - [14/Sep/2017:22:47:09 +0300] "GET /index.php HTTP/1.1" 200 26039 "-" "-"
>
> There is not difference if there is an empty user-agent or a user-agent with a dash.
>
> Any idea it shows the empty user agents with dash?

In the "common log format" widely used by web servers, the "hyphen" in the
output indicates that the requested piece of information is not available.

nginx does this in the function ngx_http_log_variable() in the file
src/http/modules/ngx_http_log_module.c. If the difference between empty
and dash matters to you, that is where you would probably change it.

        f
--
Francis Daly        [hidden email]
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx