简体   繁体   English

"如何通过 REST API 从 Apache Ranger 中提取审计日志"

[英]How to extract audit log from Apache Ranger via REST API

I need to extract daily the audit log, I thought of using the REST API.我需要每天提取审计日志,我想到了使用 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<\/a>我看到了这个链接: https<\/a> : \/\/ranger.apache.org\/apidocs\/resource_AssetREST.html#resource_AssetREST_searchXPolicyExportAudits_GET<\/a>

In this case the request is:在这种情况下,请求是:

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

Here are two examples, one to get policies, one to get audits.这里有两个示例,一个用于获取策略,一个用于获取审计。 The platform is Cloudera CDP 7.1.7 Base:该平台是 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?我的主机名是 gromit 因为谁不喜欢 Wallace 和 Gromit?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM