We should additionally set either "rgw remote addr param" or "rgw log http headers" with "HTTP_X_FORWARDED_FOR" otherwise the remote ip is always 127.0.0.1.
$ juju config ceph-radosgw \ config-flags='{"global":{"rgw enable ops log": true, "rgw remote addr param": "HTTP_X_FORWARDED_FOR"}}'
{ "bucket": "simplestreams", "time": "2023-06-01T13:10:00.060561Z", "time_local": "2023-06-01T13:10:00.060561+0000", "remote_addr": "192.168.151.107", "object_owner": "1515718f5892428fa97d4641243848ed", "user": "anonymous", "operation": "get_obj", "uri": "GET /simplestreams/foo HTTP/1.1", "http_status": "200", "error_code": "", "bytes_sent": 0, "bytes_received": 0, "object_size": 0, "total_time": 4, "user_agent": "curl/7.81.0", "referrer": "", "trans_id": "tx00000ff5efd6ded2863e0-00647898a8-9207-default", "authentication_type": "Local", "temp_url": false },
$ juju config ceph-radosgw \ config-flags='{"global":{"rgw enable ops log": true, "rgw log http headers": "http_x_forwarded_for"}}'
{ "bucket": "simplestreams", "time": "2023-06-01T12:44:27.316514Z", "time_local": "2023-06-01T12:44:27.316514+0000", "remote_addr": "127.0.0.1", "object_owner": "1515718f5892428fa97d4641243848ed", "user": "anonymous", "operation": "get_obj", "uri": "GET /simplestreams/foo HTTP/1.1", "http_status": "200", "error_code": "", "bytes_sent": 0, "bytes_received": 0, "object_size": 0, "total_time": 8, "user_agent": "curl/7.81.0", "referrer": "", "http_x_headers": [ { "HTTP_X_FORWARDED_FOR": "192.168.151.107" } ], "trans_id": "tx000002dcd7463dff3832f-00647892ab-8c1f-default", "authentication_type": "Local", "temp_url": false }
We should additionally set either "rgw remote addr param" or "rgw log http headers" with "HTTP_X_ FORWARDED_ FOR" otherwise the remote ip is always 127.0.0.1.
$ juju config ceph-radosgw \ flags=' {"global" :{"rgw enable ops log": true, "rgw remote addr param": "HTTP_X_ FORWARDED_ FOR"}}'
config-
{
"bucket" : "simplestreams", 01T13:10: 00.060561Z" ,
"time_ local": "2023-06- 01T13:10: 00.060561+ 0000",
"remote_ addr": "192.168.151.107",
"object_ owner": "1515718f589242 8fa97d464124384 8ed",
"operation ": "get_obj",
"http_ status" : "200",
"error_ code": "",
"bytes_ sent": 0,
"bytes_ received" : 0,
"object_ size": 0,
"total_ time": 4,
"user_ agent": "curl/7.81.0",
"referrer" : "",
"trans_ id": "tx00000ff5efd6 ded2863e0- 00647898a8- 9207-default" ,
"authentic ation_type" : "Local",
"temp_ url": false
"time": "2023-06-
"user": "anonymous",
"uri": "GET /simplestreams/foo HTTP/1.1",
},
$ juju config ceph-radosgw \ flags=' {"global" :{"rgw enable ops log": true, "rgw log http headers": "http_x_ forwarded_ for"}}'
config-
{
"bucket" : "simplestreams", 01T12:44: 27.316514Z" ,
"time_ local": "2023-06- 01T12:44: 27.316514+ 0000",
"remote_ addr": "127.0.0.1",
"object_ owner": "1515718f589242 8fa97d464124384 8ed",
"operation ": "get_obj",
"http_ status" : "200",
"error_ code": "",
"bytes_ sent": 0,
"bytes_ received" : 0,
"object_ size": 0,
"total_ time": 8,
"user_ agent": "curl/7.81.0",
"referrer" : "",
"http_ x_headers" : [
" HTTP_X_ FORWARDED_ FOR": "192.168.151.107"
"trans_ id": "tx000002dcd746 3dff3832f- 00647892ab- 8c1f-default" ,
"authentic ation_type" : "Local",
"temp_ url": false
"time": "2023-06-
"user": "anonymous",
"uri": "GET /simplestreams/foo HTTP/1.1",
{
}
],
}