virajjasani commented on PR #5385: URL: https://github.com/apache/hadoop/pull/5385#issuecomment-1433622305
> https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/Compatibility.html#Audit_Log_Output I see, thanks for sharing this. Interesting, I am not sure if this means that audit log must not print client's hostname in addition to it's IP address. If that is the intention, i.e. if audit log is only meant to print IP address only regardless of the resolution of InetAddress toString(), we should have this logic: ``` diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index 95b855e8af4..c06cb43d43b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -8787,7 +8787,7 @@ public void logAuditEvent(boolean succeeded, String userName, sb.setLength(0); sb.append("allowed=").append(succeeded).append("\t") .append("ugi=").append(userName).append("\t") - .append("ip=").append(addr).append("\t") + .append("ip=").append("/").append(addr.getHostAddress()).append("\t") .append("cmd=").append(cmd).append("\t") .append("src=").append(src).append("\t") .append("dst=").append(dst).append("\t"); ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
