VMware NSX

 View Only
  • 1.  Retrieving NSX-T gzipped logs from appliances

    Posted Mar 24, 2023 04:50 PM

    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.


  • 2.  RE: Retrieving NSX-T gzipped logs from appliances

    Posted Mar 25, 2023 08:19 AM

    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