RANGER-5404 Modify the evtTime format to avoid format errors in ES #739
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.

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 compiledranger-plugins-audit*.jarfile 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.

After fix: HDFS audit logs are also displayed correctly.
