VMware Networking Community
mafteiu
Contributor
Contributor

Retrieving NSX-T gzipped logs from appliances

Hi,

I am trying to retrieve archived logs from Edge appliances using REST API (NSX-T 3.2.2):

GET
URI Path(s):
/api/v1/transport-nodes/<transport-node-id>/node/logs/<log-name>/data
The problem is the downloaded .gz files are corrupted.
7zip would extract a few k (1 to 15k), then would fail with an error, gzip will directly return invalid compressed data--format violated without extracting anything. To note that the little amount of data extracted with 7z is readable.
I've tried using
invoke-webrequest, invoke-restmethod, System.Net.WebClient class - in pwsh 7.3
curl and wget in bash
Same result.
Has anyone succeeded in retrieving this?
Thanks.
Tags (3)
Reply
0 Kudos
1 Reply
mafteiu
Contributor
Contributor

Something interesting I noticed, in the REST API docs it says:

Response Code:
200 OK, 206 Partial Content
Response Headers:
FileRequestHeaders
Content-type: application/octet-stream
 
whereas a Fiddler trace shows:
Content-Type: text/html;charset=UTF-8
Reply
0 Kudos