Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to fetch ranger live logs from solr?

How to fetch ranger live logs from solr?

Expert Contributor

Hi Everyone,

I have downloaded HDP 2.5 on which ranger is by default configured with solr.In earlier HDP version it was configured with postgres to store audit logs,so it was easy job to fetch the logs from DB using java code.but now i don't understand How can i fetch all the audit logs from solr using java?

And there is one more doubt,I did so many task in hive and all logs are getting reflected correctly with current date in ranger audit tab.but After querying on solr UI it's displaying old logs i think logs are not getting stored in solr.

so what could be the reason behind that?

As i am very ne to use solr so could you please guys, guid me in fetching those logs from solr.

I queried in solr as given below:

http://hostname:8886/solr/ranger_audits_shard1_replica1/select?q=*%3A*&wt=json&indent=true

output:

output.txt

Apache Ambari Audit configuration tab:

config-tab.png

Please help me to solve this issue.

Thanks in advance,

1 REPLY 1
Highlighted

Re: How to fetch ranger live logs from solr?

SolrJ is a great way to query Solr using Java: https://cwiki.apache.org/confluence/display/solr/Using+SolrJ

Don't have an account?
Coming from Hortonworks? Activate your account here