@echo off setlocal enabledelayedexpansion REM Define variables for log monitoring set…
- User
@echo off setlocal enabledelayedexpansion
REM Define variables for log monitoring set "LOCAL_LOG=%~dp0^[ssh misopr@bgcgcdb1^] (2025-04-07_075209) bgcgcdb1 (misopr).log" set "KEYWORDS_FILE=%~dp0keywords.txt"
:: Monitor local log file with PowerShell cls & echo Waiting for Log powershell -NoProfile -ExecutionPolicy Bypass -Command ^ "_ -match '\S' }; " ^ "Get-Content -LiteralPath "%LOCAL_LOG%" -Wait -Tail 10 | ForEach-Object { " ^ "_.Trim(); " ^ "if (-not [string]::IsNullOrEmpty(line -ne '-1') { " ^ "line -split ' '; " ^ "if (secondWord = matches = secondWord -ieq matches) { " ^ "if (line" -ForegroundColor Red; " ^ "} elseif (line" -ForegroundColor Green; " ^ "secondWord.mp3"; " ^ "cmd /c msg %username% /time:5 "keyword") { " ^ "cmd /c ffplay "null | Out-Null; " ^ "} " ^ "} " ^ "} " ^ "} " ^ "} " ^ "}"
- Assistant
- User
Get-Content : An object at the specified path D:\Prapun\tail_gold[ssh misopr@bgcgcdb1] (2025-04-07_075209) bgcgcdb1 (misopr).log does not exist, or has been filtered by the -Include or -Exclude parameter. At line:1 char:96
- ... ch '\S' }; Get-Content -LiteralPath "D:\Prapun\tail_gold[ssh misopr ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~- CategoryInfo : ObjectNotFound: (System.String[]:String[]) [Get-Content], Exception
- FullyQualifiedErrorId : ItemNotFound,Microsoft.PowerShell.Commands.GetContentCommand
- Assistant
The error message you're seeing indicates that the PowerShell command cannot find the specified log file at the provided path, which is causing the command to fail. Here's how you can troubleshoot and resolve the issue:
- User
log file i got from mobaxterm how change save log file in mobaxterm
- Assistant
- User
if i have only one .log get that only one file
- Assistant
- User
@echo off setlocal enabledelayedexpansion
REM Define variables for log monitoring set "LOCAL_LOG=%~dp0^[ssh misopr@bgcgcdb1^] (2025-04-07_093553) bgcgcdb1 (misopr).log" set "KEYWORDS_FILE=%~dp0keywords.txt"
:: Monitor local log file with PowerShell cls & echo Waiting for Log powershell -NoProfile -ExecutionPolicy Bypass -Command ^ "_ -match '\S' }; " ^ "Get-Content -LiteralPath "%LOCAL_LOG%" -Wait -Tail 10 | ForEach-Object { " ^ "_.Trim(); " ^ "if (-not [string]::IsNullOrEmpty(line -ne '-1') { " ^ "line -split ' '; " ^ "if (secondWord = matches = secondWord -ieq matches) { " ^ "if (line" -ForegroundColor Red; " ^ "} elseif (line" -ForegroundColor Green; " ^ "secondWord.mp3"; " ^ "cmd /c msg %username% /time:5 "keyword") { " ^ "cmd /c ffplay "null | Out-Null; " ^ "} " ^ "} " ^ "} " ^ "} " ^ "} " ^ "}"
- Assistant