How to load only lines with a specific ID from a file on an SFTP server?

Advertisement

bealefay
Guest

How to load only lines with a specific ID from a file on an SFTP server?

I created a bat file that runs a WinSCP script to download a log file (response log) from a remote server.
The log file is explicitly loaded as is (responses from all requests).
How can I limit the download of a log file specific to my request? My request has a unique identifier. How can I truncate a response specific to my unique identifier?
The script in my bat file is below:
winscp.com/command ^
    "open sftp://xxx.com/ -hostkey=*" "get /var/log/jboss_sit/suFile.log" "exit" ^
Last edited by bealefay on 2020-04-24 03:13; edited 1 time in total

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,253
Location:
Prague, Czechia

Re: How to load only lines with a specific ID from a file on an SFTP server?

There's no way to do that using SFTP protocol.
You would need to use appropriate shell commands (if you have a shell access), like grep, using SSH terminal client.

Reply with quote

Advertisement

You can post new topics in this forum