I have a text winscp log as follows
. 2020-03-07 10:01:31.776 --------------------------------------------------------------------------
. 2020-03-07 10:01:31.776 Using SFTP protocol.
. 2020-03-07 10:01:31.776 Doing startup conversation with host.
> 2020-03-07 10:01:31.776 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2020-03-07 10:01:33.370 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2020-03-07 10:01:33.370 SFTP version 3 negotiated.
. 2020-03-07 10:01:33.370 We believe the server has signed timestamps bug
. 2020-03-07 10:01:33.370 We will use UTF-8 strings until server sends an invalid UTF-8 string as with SFTP version 3 and older UTF-8 strings are not mandatory
. 2020-03-07 10:01:33.370 Getting current directory name.
. 2020-03-07 10:01:33.370 Getting real path for '.'
> 2020-03-07 10:01:33.370 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2020-03-07 10:01:33.370 Type: SSH_FXP_NAME, Size: 70, Number: 16
. 2020-03-07 10:01:33.370 Real path is '/sftp.[Redacted]'
. 2020-03-07 10:01:33.370 Startup conversation with host finished.
< 2020-03-07 10:01:33.370 Script: Active session: [1] [Redacted]
> 2020-03-07 10:01:33.370 Script: lcd "[Redacted]"
< 2020-03-07 10:01:33.370 Script: [Redacted]
> 2020-03-07 10:01:33.385 Script: put myFile.csv -nopreservetime
. 2020-03-07 10:01:33.385 Copying 1 files/directories to remote directory "[Redacted]" - total size: 61,938
. 2020-03-07 10:01:33.385 PrTime: No; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask:
. 2020-03-07 10:01:33.385 TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; InclM: ; ResumeL: 0
. 2020-03-07 10:01:33.385 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2020-03-07 10:01:33.385 Getting real path for '[Redacted]'
> 2020-03-07 10:01:33.385 Type: SSH_FXP_REALPATH, Size: 58, Number: 272
< 2020-03-07 10:01:33.385 Type: SSH_FXP_NAME, Size: 70, Number: 272
. 2020-03-07 10:01:33.385 Real path is '[Redacted]'
. 2020-03-07 10:01:33.385 File: 'myFile.csv' [2020-03-07T10:01:31.074Z] [61938]
. 2020-03-07 10:01:33.417 Copying "myFile.csv" to remote directory started.
. 2020-03-07 10:01:33.417 Binary transfer mode selected.
. 2020-03-07 10:01:33.417 Opening remote file.
> 2020-03-07 10:01:33.417 Type: SSH_FXP_OPEN, Size: 85, Number: 515
< 2020-03-07 10:01:33.557 Type: SSH_FXP_HANDLE, Size: 10, Number: 515
> 2020-03-07 10:01:33.557 Type: SSH_FXP_WRITE, Size: 32764, Number: 1030
. 2020-03-07 10:01:33.573 1 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
> 2020-03-07 10:01:33.573 Type: SSH_FXP_CLOSE, Size: 10, Number: 1540
< 2020-03-07 10:01:33.588 Type: SSH_FXP_STATUS, Size: 32, Number: 1030
< 2020-03-07 10:01:33.588 Status code: 0
< 2020-03-07 10:01:33.588 Type: SSH_FXP_STATUS, Size: 32, Number: 1286
< 2020-03-07 10:01:33.588 Status code: 0
< 2020-03-07 10:01:33.667 Type: SSH_FXP_STATUS, Size: 32, Number: 1540
< 2020-03-07 10:01:33.667 Status code: 0
. 2020-03-07 10:01:33.667 Transfer done: 'myFile.csv' => '[Redacted]' [61938]
. 2020-03-07 10:01:33.667 Copying finished: Transferred: 61,938, Elapsed: 0:00:00, CPS: 267,853/s
> 2020-03-07 10:01:33.667 Script: exit
. 2020-03-07 10:01:33.667 Script: Exit code: 0
. 2020-03-07 10:01:33.667 Closing connection.
. 2020-03-07 10:01:33.667 Sending special code: 12
. 2020-03-07 10:01:33.667 Sent EOF message
Is it possible from this log to find the file size of myFile.csv that was transferred?
I might guess that this is what the Transferred
field in the line Copying finished: Transferred: 61,938, Elapsed: 0:00:00, CPS: 267,853/s
contains - is that right? if so, what are the units?
I have been unable to find online any documentation on what all these lines of log actually mean - some of them are plain English enough to be understood, but many contain terms and references that I do not understand. All searches for specific codes have been successful (special code 12 closes the connection for instance), but I cannot find any help determining the file size of the file that was successfully transferred - all such queries lead to questions about the log file size, not the transferred file.
Any help greatly appreciated. If you know of any documentation on reading the logs, a link would also be really helpful!
EDIT: To be clear, I need to interpret the logs that have been produced in the past; this is not a question about in future using the logs to return the file size. I would like to know the file size that was transferred on some specific dates.
In future, I would try to avoid trying to interpret WinSCP session log files.
Use XML logging instead.
Or use WinSCP .NET assembly instead of plain scripting.
However, if you are stuck with the log, you can see the file size in the following line:
. 2020-03-07 10:01:33.667 Transfer done: 'myFile.csv' => '[Redacted]' [61938]
in this case, the file size is 61938.