Skip to content

Conversation

@yunyezhang-work
Copy link

What changes were proposed in this pull request?

The HDFS audit logs were not displaying on the Ranger UI. It was discovered that the HDFS audit logs were not being written to Elasticsearch. Enabling the debug logs in the HDFS plugin revealed an error related to the evtTime format. To understand the evtTime formats accepted by Elasticsearch, we enabled Hive auditing and found that the Hive audit logs were displayed correctly on the Ranger UI. Therefore, we modified ElasticSearchAuditDestination.java to ensure that the time format in the HDFS audit logs matched that of Elasticsearch.
image

How was this patch tested?

To enable auditing, modify the Ranger and HDFS configurations:
Ranger: ranger.audit.elasticsearch.bootstrap.enabled=true
HDFS: xasecure.audit.is.enabled=true

Executing the basic HDFS commands revealed that the corresponding audit information is not displayed in the Ranger UI. Modify ElasticSearchAuditDestination.java, then compile and package it. Replace the newly compiled ranger-plugins-audit*.jar file in the environment. Restart Ranger and execute the HDFS commands again. Now the Ranger UI displays the audit logs.

Before fix: Only Hive audit logs are displayed.
image

After fix: HDFS audit logs are also displayed correctly.
image

@kumaab
Copy link
Contributor

kumaab commented Nov 26, 2025

Thank you @yunyezhang-work for the patch! please raise a PR for the master branch it is the branch for all dev work.

@yunyezhang-work
Copy link
Author

Thank you @yunyezhang-work for the patch! please raise a PR for the master branch it is the branch for all dev work.
Thank you for your review. The new PR link is as follows:
#746

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants