Public Hosting Request Logs

A PublicHostingRequestLog is an audit log for monitoring requests we received to access your publicly served folders.

Logs available through this endpoint are retained for 6 months, after which they are automatically discarded. For longer retention, use Files.com SIEM integrations to stream logs in real time to your preferred SIEM, or configure SIEM streaming to a file.

List Public Hosting Request Logs

SDK Method

publichostingrequestlog.List()

Return Object

[]*PublicHostingRequestLog

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    public_hosting_request_log "github.com/Files-com/files-sdk-go/v3/publichostingrequestlog"
)

publicHostingRequestLogIterator, err := public_hosting_request_log.List(files_sdk.PublicHostingRequestLogListParams{})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

for publicHostingRequestLogIterator.Next() {
    publicHostingRequestLog := publicHostingRequestLogIterator.publicHostingRequestLog()
}
err = publicHostingRequestLogIterator.Err()
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

The PublicHostingRequestLog Object

Some of the methods above return a PublicHostingRequestLog object. The attributes of this object are listed below.

AttributeDescription
Timestamp
date-time
Start Time of Action. Deprecrated: Use created_at.
RemoteIp
string
IP Address of Public Hosting Client.
ServerIp
string
IP Address of Public Hosting Server.
Hostname
string
HTTP Request Hostname.
Path
string
HTTP Request Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
ResponseCode
int64
HTTP Response Code.
Success
boolean
Whether SFTP Action was successful.
DurationMs
int64
Duration (in milliseconds).
CreatedAt
date-time
Start Time of Action.
BytesTransferred
int64
The number of bytes transferred for file downloads.
HttpMethod
string
Method of the HTTP call.