Re: RGW: Using Lua script to monitor storage class put operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
The RGWDebugLog() function is writing debug logs at level 20, so you have
to make sure that debug_rgw = 20
Also, if Request.HTTP.StorageClass does not exist in the message (is "nil")
the string concat operator would fail, and the script would exit. So, it is
probably better to check that in the condition.

Yuval

On Sun, May 14, 2023 at 10:44 AM <viplanghe6@xxxxxxxxx> wrote:

> I have a lua script that read Storageclass header of any put request (as I
> understand):
> local function isempty(input)
>   return input == nil or input == ''
> end
>
> if Request.RGWOp == 'put_obj' then
>   RGWDebugLog("Put_Obj with StorageClass: " .. Request.HTTP.StorageClass )
> end
>
> Then apply the script:
> radosgw-admin script put --infile=storage_class.lua --context=preRequest
>
> Then put an object using boto3:
> s3.Object(bucket, 'test-object').put(Body="0"*100, ACL='public-read',
> StorageClass='COLD')
>
> But I can't find any log about it in radosgw log?
> grep -i Lua /var/log/ceph/ceph-client.rgw.ceph1.log
>
> Anyone have any ideal? Thanks
> _______________________________________________
> ceph-users mailing list -- ceph-users@xxxxxxx
> To unsubscribe send an email to ceph-users-leave@xxxxxxx
>
>
_______________________________________________
ceph-users mailing list -- ceph-users@xxxxxxx
To unsubscribe send an email to ceph-users-leave@xxxxxxx




[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Ceph Dev]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux