In Mapr's audit log , there is a filed called volumeID, how can I convert it to volume name?
thanks and regards,
It will take a bit of cleverness. The Volume ID is an attribute of a volume and you can see this in the output of 'maprcli volume list'. You could run that command with a filter to return only that volume and then extract out the volumename. A slightly more efficient approach would be to run volume list once, remember all of the volumeID to volumename mappings and use that.
Please use the expandaudit tool to convert the volumeID (in audit log) to volume name.
Details and the usage can be found at expandaudit - MapR 5.0 Documentation - doc.mapr.com
Is it possible to convert the ids to name in real time?
Does a simple grep for the volume ID in the cldb.log from the event below suffice to meet your requirement?
2016-06-21 12:49:38,637 INFO VolumeCreateManager [Thread-2]: VolumeCreate: Created volume mapr.cluster.root RootContainer: Container ID:2049* vol:219895431 Servers: 10.10.70.72 Volume UUID: -58346161356570322
Thanks you for your info.
But my current problem is :
1. I need remote access to the mapr node, so I cann't run that shell command...
2. Can I make a rest api call to that mapr service, if so, what query should I use?
3. If not through rest api, what mapr java class can I use to run this command?
Thanks and regards,
All maprcli commands can also be executed over REST. The details are in the docs. Here's the URL for the maprcli volume list command which includes REST information. MapR 5.1 Documentation
Thank you so much, this is very helpful.
What about user id in auditlog? I didn't find a rest api to get the userid information.
We don't provide an API as far as I know to convert a uid to a username. That's just standard OS stuff. If your client has a registry consistent with the server you can just make local OS calls. If it doesn't, things will get tricky - perhaps you could cache the information locally or you'll need some kind of service on the server to help. Keep in mind that if you use LDAP you could probably query that directly.
Got it thanks, really helpful.
Retrieving data ...