Skip to main content
Solved

Export Netbrain System Audit Logs

  • October 21, 2021
  • 1 reply
  • 178 views

Rakesh Mandava
Forum|alt.badge.img+1

I need to export all audit logs of Netbrain into a file or database on monthly basis. How to export "audit logs" from "System Management" to a csv file ? 

Best answer by pradeep.gaddameedi

Hi Rakesh, 

First of all you need Highest level privilege access to do that. From the NetBrain REST API (NetBrain-REST-API-R10), you can use the API Server URL : “http(s)://NetBrain-WebAPI-IP/ServicesAPI/API/V1/CMDB/AuditLogs”. Here you have an option to filter the audit logs based on the time frame, tenant id, domain id etc. The output will be in JSON format sorted from the latest to earliest. 

 

Sample output:

{
"auditLogs":[
{
"time":"2020-05-26T14:18:22.785Z",
"userName":"ui.user1",
"tenantName":"Initial Tenant",
"domainName":"Initial Domain",
"machineName":"pool-96-237-64-80",
"ipAddress":"96.237.64.81",
"userAgent":"Chrome",
"module":"System Advanced Settings",
"message":"Enable Audit Log",
"status":0
},
{
"time":"2020-05-26T14:18:42.536Z",
"userName":"api.user1",
"tenantName":"",
"domainName":"",
"machineName":"pat-149-96-5-12",
"ipAddress":"149.96.5.12",
"userAgent":"Unknown",
"module":"Login",
"message":"Log in to get an authentication token with username api.user.",
"status":0
}
],
"statusCode": 790200,
"statusDescription":"Success."
}

 

For more info in API documentation please follow below link:

Audit Logs REST API Design

 

Thanks

1 reply

pradeep.gaddameedi
Forum|alt.badge.img
  • Community Manager
  • 22 replies
  • Answer
  • October 21, 2021

Hi Rakesh, 

First of all you need Highest level privilege access to do that. From the NetBrain REST API (NetBrain-REST-API-R10), you can use the API Server URL : “http(s)://NetBrain-WebAPI-IP/ServicesAPI/API/V1/CMDB/AuditLogs”. Here you have an option to filter the audit logs based on the time frame, tenant id, domain id etc. The output will be in JSON format sorted from the latest to earliest. 

 

Sample output:

{
"auditLogs":[
{
"time":"2020-05-26T14:18:22.785Z",
"userName":"ui.user1",
"tenantName":"Initial Tenant",
"domainName":"Initial Domain",
"machineName":"pool-96-237-64-80",
"ipAddress":"96.237.64.81",
"userAgent":"Chrome",
"module":"System Advanced Settings",
"message":"Enable Audit Log",
"status":0
},
{
"time":"2020-05-26T14:18:42.536Z",
"userName":"api.user1",
"tenantName":"",
"domainName":"",
"machineName":"pat-149-96-5-12",
"ipAddress":"149.96.5.12",
"userAgent":"Unknown",
"module":"Login",
"message":"Log in to get an authentication token with username api.user.",
"status":0
}
],
"statusCode": 790200,
"statusDescription":"Success."
}

 

For more info in API documentation please follow below link:

Audit Logs REST API Design

 

Thanks