[ 
https://issues.apache.org/jira/browse/HDFS-5683?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Abhiraj Butala updated HDFS-5683:
---------------------------------

    Attachment: HDFS-5683.001.patch

I addressed the above issue and made appropriate changes to FSNamesystem.java. 
Giving below some examples of the caching audit logs with the patch:

{noformat}
14/03/29 02:00:59 INFO FSNamesystem.audit: allowed=true ugi=abutala 
(auth:SIMPLE)       ip=/127.0.0.1   cmd=addCacheDirective   src={id: 8, path: 
/user/abutala/abhiraj, replication: 1, pool: pool7, expiration: 
73071270-05-24T21:49:13-0700} dst=null        perm=null
14/03/29 02:01:49 INFO FSNamesystem.audit: allowed=true ugi=abutala 
(auth:SIMPLE)       ip=/127.0.0.1   cmd=modifyCacheDirective        src={id: 8} 
    dst={id: 8, path: /user/abutala/abhiraj/tmp2}   perm=null
14/03/29 02:03:35 INFO FSNamesystem.audit: allowed=true ugi=abutala 
(auth:SIMPLE)       ip=/127.0.0.1   cmd=listCacheDirectives src={}  dst=null    
    perm=null
14/03/29 02:03:47 INFO FSNamesystem.audit: allowed=true ugi=abutala 
(auth:SIMPLE)       ip=/127.0.0.1   cmd=listCacheDirectives src={pool: pool2}   
    dst=null        perm=null
14/03/29 02:04:02 INFO FSNamesystem.audit: allowed=true ugi=abutala 
(auth:SIMPLE)       ip=/127.0.0.1   cmd=listCacheDirectives src={path: 
/user/abutala/abhiraj, pool: pool2}  dst=null        perm=null
14/03/29 02:05:54 INFO FSNamesystem.audit: allowed=true ugi=abutala 
(auth:SIMPLE)       ip=/127.0.0.1   cmd=removeCacheDirective        src={id: 8} 
    dst=null        perm=null
14/03/29 02:08:44 INFO FSNamesystem.audit: allowed=true ugi=abutala 
(auth:SIMPLE)       ip=/127.0.0.1   cmd=addCachePool        
src={poolName:pool10, ownerName:abutala, groupName:abutala, mode:0755, 
limit:9223372036854775807, maxRelativeExpiryMs:2305843009213693951}      
dst=null        perm=null
14/03/29 02:09:58 INFO FSNamesystem.audit: allowed=true ugi=abutala 
(auth:SIMPLE)       ip=/127.0.0.1   cmd=modifyCachePool     src={poolName: 
pool10}  dst={poolName:pool10, ownerName:null, groupName:null, mode:0666, 
limit:null, maxRelativeExpiryMs:null}  perm=null
14/03/29 02:11:21 INFO FSNamesystem.audit: allowed=true ugi=abutala 
(auth:SIMPLE)       ip=/127.0.0.1   cmd=removeCachePool     src={poolName: 
pool10}  dst=null        perm=null
{noformat}


For modifyCacheDirective and modifyCachePool, I put the final changes in 'dst' 
section and the 'src' section only has the id or pool name being modified 
respectively. Also, not including any tests as this is just an update to the 
logs.  

Kindly review and let me know if there are any issues. Thank you!

> Better audit log messages for caching operations
> ------------------------------------------------
>
>                 Key: HDFS-5683
>                 URL: https://issues.apache.org/jira/browse/HDFS-5683
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: namenode
>    Affects Versions: 3.0.0, 2.3.0
>            Reporter: Andrew Wang
>              Labels: caching
>         Attachments: HDFS-5683.001.patch
>
>
> Right now the caching audit logs aren't that useful, e.g.
> {noformat}
> 2013-12-18 14:14:54,423 INFO  FSNamesystem.audit 
> (FSNamesystem.java:logAuditMessage(7362)) - allowed=true     ugi=andrew 
> (auth:SIMPLE)        ip=/127.0.0.1   cmd=addCacheDirective   src=null        
> dst=null        perm=null
> {noformat}
> It'd be good to include some more information when possible, like the path, 
> pool, id, etc.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to