SFTP Action Logs

An SFTPActionLog is an audit log for monitoring and troubleshooting operations made to your site through SFTP protocol.

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 SFTP Action Logs

SDK Method

sftpactionlog.List()

Return Object

[]*SftpActionLog

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"
    sftp_action_log "github.com/Files-com/files-sdk-go/v3/sftpactionlog"
)

sftpActionLogIterator, err := sftp_action_log.List(files_sdk.SftpActionLogListParams{})
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 sftpActionLogIterator.Next() {
    sftpActionLog := sftpActionLogIterator.sftpActionLog()
}
err = sftpActionLogIterator.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 SftpActionLog Object

Some of the methods above return a SftpActionLog 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 SFTP Client
ServerIp
string
IP Address of SFTP Server
Username
string
Username
SshClientIdentification
string
Name of the SFTP Client provided at initial connection
SessionUuid
string
Unique ID of the Session
SeqId
int64
SFTP Sequence ID
AuthMethod
string
Authentication Method
AuthCiphers
string
Authentication Ciphers
ActionType
string
Action Type
Path
string
Path as sent by the Client (may not match Files.com path due to user root folders for SFTP). This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
TruePath
string
Path on Files.com
Name
string
Name of File
SftpResponseCode
string
SFTP Response Code Returned to the Client.
SftpResponseMessage
string
SFTP Response Message Returned to the Client.
Md5
string
MD5 Hash of the file. Not always available.
Size
int64
Size of File That was Uploaded or Downloaded.
DataLength
int64
Data Length in Bytes. Present for actions that transfer data.
BytesTransferred
int64
The number of bytes transferred for uploads and downloads.
EntriesReturned
int64
Number of entries returned when listing files and folders
Success
boolean
Whether SFTP Action was successful.
Status
string
SFTP Action status.
Possible values: SUCCESS, FAILURE, PARTIAL_TRANSFER
DurationMs
int64
Duration (in milliseconds)
CreatedAt
date-time
Start Time of Action