私の質問select-stringでVirtualnameを選択する方法はありますか?これらのログは、時間と仮想アカウント名を選択する必要がある場所から取得しています。私
*> <event seq="453211" time="2019-01-24 11:01:03.639873 -0500" app="hServer 7.45" name="I_SFS_TRANSFER_FILE" desc="Virtual filesystem: transfer file.">
<session id="44500" service="SSH" remoteAddress="00.00.00:57292" virtualAccount="xxxxxxxx" windowsAccount="Server3\Users"/>
<channel type="session" id="1"/>
<sfs moduleName="FlowSfsWin" mountPath="/" code="90000" desc="Transferring file ended.">*
これは私が今まで試したことです。
New-Item "C:\clients.log" -type file -force
$strings = "virtualAccount=","time="
Foreach($string in $strings){
Get-Content 'C:\uploads.log'|
Select-String $string1 -AllMatches | % { $_.Matches } | % { $_.Value } |
Add-Content "C:\clients.log"
}
ログファイルごとに1つ以上のvirtualAccountおよびtimeフィールドがありますか?ファイルごとにさらにある場合:情報は1行で表示されますか、または例のように改行が含まれていますか?
—
ゲルトヤンクレイエフェルド
私はコピーされたより、そのわずか1行があります
—
ジョンが描いた
期待する結果を示す必要があります。
—
LotPings