Reply
Accepted Solution

Retrieve syslog data using WAPI

garycs
Techie
Posts: 3
1928     0

I want to retrieve syslog records from the Infoblox directly.

 

I have 2 questions.

 

1. How do I find out the number of syslog files on the Infoblox?

2. How do I retrieve syslog records from the active syslog file and prior syslog files?

Re: Retrieve syslog data using WAPI

Moderator BRampling
Moderator
Posts: 87
1929     0

I don't believe there is a way to determine the number of log files via the WAPI, but here is how you download all of them. Prepare NIOS for the download:

curl -k1 -u admin:infoblox -H "Content-Type: application/json" -X POST https://10.60.27.4/wapi/v2.5/fileop?_function=get_log_files -d '{"include_rotated":true,"log_type":"SYSLOG","member":"infoblox.localdomain","node_type":"ACTIVE"}'

{
    "token": "eJydUEFuwyAQvO9H0kuwcRLb6S2VG6lSlEhJpR5XNmB3JRso4Crp6wuR2lNPPYCWndlZZoQw9oZO\nDRAvYbQPbhbBOLAcHgTp3nSjuTKjVTrhZpWHpg0tnlUPtgCB2M00BtKIIEkEsCt4kHYNl4W6WnI3\nDDSpBdgN7Pm6zqu8qlcVK4uyrCvwl8XsxoiWkf8egvWPWcZzVuasqNg6Sy2UFL8WsKdRIZnMqQ8k\nuWxOb8fDadcseZ7zzN/8wQwstI4NX1HvLk0yVnVU/mskQttEktFNrHkeeZmP1ttBZWGy/9/N+Y8u\nKi2MJD2kbhEXPL0cU7n6JUxGpnB4yqvZve7w/LxP7w34cLa8TFnyKoI9qVF6DAaFmWzr7lM1HJPN\nrrVI2s4BP5XzZHTCthHr2DcwepdE\n", 
    "url": "https://10.60.27.4/http_direct_file_io/req_id-DOWNLOAD-1001/sysLog.tar.gz"
}

Download the file:


curl -k1 -u admin:infoblox -H "Content-type:applicatin/force-download" -O https://10.60.27.4/http_direct_file_io/req_id-DOWNLOAD-1001/sysLog.tar.gz curl -k1 -u admin:testpw -H "Content-type:application/force-download" -O https://10.60.27.4/http_direct_file_io/req_id-DOWNLOAD-1001/sysLog.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 401 100 401 0 0 2079 0 --:--:-- --:--:-- --:--:-- 2077

Notify NIOS that the download is complete:

curl -k1 -u admin:infoblox -H "Content-Type: application/json" -X POST https://10.60.27.4/wapi/v2.5/fileop?_function=downloadcomplete -d '{ "token": "eJydUEFuwyAQvO9H0kuwcRLb6S2VG6lSlEhJpR5XNmB3JRso4Crp6wuR2lNPPYCWndlZZoQw9oZO\nDRAvYbQPbhbBOLAcHgTp3nSjuTKjVTrhZpWHpg0tnlUPtgCB2M00BtKIIEkEsCt4kHYNl4W6WnI3\nDDSpBdgN7Pm6zqu8qlcVK4uyrCvwl8XsxoiWkf8egvWPWcZzVuasqNg6Sy2UFL8WsKdRIZnMqQ8k\nuWxOb8fDadcseZ7zzN/8wQwstI4NX1HvLk0yVnVU/mskQttEktFNrHkeeZmP1ttBZWGy/9/N+Y8u\nKi2MJD2kbhEXPL0cU7n6JUxGpnB4yqvZve7w/LxP7w34cLa8TFnyKoI9qVF6DAaFmWzr7lM1HJPN\nrrVI2s4BP5XzZHTCthHr2DcwepdE\n"}'

{}

 You now have a .tar.gz file containing all of the logs.

Showing results for 
Search instead for 
Do you mean 

Recommended for You