Log File Policy to monitor Dynamic Log file when path has a space

Hello Experts, 

We need to monitor the most recent log file in this path. 

E:\Tableau\Procesos Automaticos\Poblar tablas\tabgossan_general_zonas_completa\logs\

I´ve tried this command in the log file pth section:

<`cmd /c for %f in ("E:\Tableau\Procesos Automaticos\Poblar tablas\tabgossan_general_zonas\logs\log*.txt") do @echo %~sf`>

As indicated in this KM: https://portal.microfocus.com/s/article/KM000011268?language=en_US

But I get events with this errors:

Environment variable '' requested for path '<`cmd /c for %%f in ("E:\Tableau\Procesos Automaticos\Poblar tablas\tabgossan_general_zonas\logs\log*.txt") do @echo %%~sf`>' not set. Replacing by empty string. (OpC30-141) Environment variable '' requested for path '<`cmd /c for %%f in ("E:\Tableau\Procesos Automaticos\Poblar tablas\tabgossan_general_zonas\logs\log*.txt") do @echo %%~sf`>' not set. Replacing by empty string. (OpC30-141)  The process 'cmd /c for %%f in ("E:\Tableau\Procesos Automaticos\Poblar tablas\tabgossan_general_zonas\logs\log*.txt") do @echo %%~sf' terminated with a non-zero exit code. (OpC20-432)

Kindly suggest how we can fix this issue to enable monitoring dynamic log file path which has space.

  • 0  

    This worked for me: 

    <`cmd /c for %f in ("C:\Tableau\PROCES~1\POBLAR~1\tabgossan_general_zonas\logs\log*.txt") do @echo %~sf`>

    the right folder name with dir /x should there be similar folders.

    C:\>dir /x C:\Tableau\
    Volume in drive C has no label.
    Volume Serial Number is D42B-3334

    Directory of C:\Tableau

    13.01.2025 15.39 <DIR> .
    13.01.2025 15.39 <DIR> ..
    13.01.2025 15.39 <DIR> PROCES~1 Procesos Automaticos

    Although I am an OpenText employee, I am speaking for myself and not for OpenText.
    If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button

  • 0 in reply to   

    Hello Kumitkka, 

    thanks for your answer. 

    I've applied the commnad you posted and as soon as I deploy de policy on the node I receive a Minor event with this Title.

    Environment variable '' requested for path '<`cmd /c for %%f in ("E:\Tableau\Procesos Automaticos\Poblar tablas\tabgossan_general_zonas\logs\log*.txt") do @echo %%~sf`>' not set. Replacing by empty string. (OpC30-141)
    Environment variable '' requested for path '<`cmd /c for %%f in ("E:\Tableau\Procesos Automaticos\Poblar tablas\tabgossan_general_zonas\logs\log*.txt") do @echo %%~sf`>' not set. Replacing by empty string. (OpC30-141)
    Environment variable 'f in ("C:\Tableau\PROCES~1\POBLAR~1\tabgossan_general_zonas\logs\log*.txt") do @echo ' requested for path '<`cmd /c for %f in ("C:\Tableau\PROCES~1\POBLAR~1\tabgossan_general_zonas\logs\log*.txt") do @echo %~sf`>' not set. Replacing by empty string. (OpC30-141)
    The process 'cmd /c for %%f in ("E:\Tableau\Procesos Automaticos\Poblar tablas\tabgossan_general_zonas\logs\log*.txt") do @echo %%~sf' terminated with a non-zero exit code. (OpC20-432)

    There must be something else in the server I'm monitoring. 

    Regards,

    Marta