1

I need to extract daily the audit log, I thought of using the REST API. But I don't understand how to extract it with a curl.

I saw this link: https://ranger.apache.org/apidocs/resource_AssetREST.html#resource_AssetREST_searchXPolicyExportAudits_GET

In this case the request is:

  GET /assets/exportAudit
  Content-Type: */*
  Accept: application/json
  ...

Maybe to extract the log is correctly this:

https://ranger.apache.org/apidocs/resource_AssetREST.html#resource_AssetREST_getReportLogs_GET

In this case the request is:

  GET /assets/report
  Content-Type: */*
  Accept: application/json
  ...

How I can convert it into a curl? to test it and understand if the output is what i want?

For example I want extract audit information from a HDFS Policy. Alternatively, is there a better way to extract the log?

1 Answers1

1

Here are two examples, one to get policies, one to get audits. The platform is Cloudera CDP 7.1.7 Base:

curl -iv -X GET -H "Content-type:application/json" -u 'admin:admin' \ http://gromit:6080/service/plugins/policies
curl -iv -X GET -H "Content-type:application/json" -u 'admin:admin' \ http://gromit:6080/service/assets/accessAudit

My hostname is gromit because who doesn't like Wallace and Gromit?

Henry Ecker
  • 34,399
  • 18
  • 41
  • 57
Marty
  • 11
  • 1