9
responses

I have tried multiple ways to get the wildcard includes to work but just cant get it to work in CE. If I put the path in then it works.

define ROOT C:\Program Files (x86)\nxlog
define PLUGIN %ROOT%\additional

works:
include C:\Program Files (x86)\nxlog\additional\nxlog_exchange.conf

doesn't work:
include additional\*.conf
include additional/*.conf
include %PLUGIN%\*.conf
include %PLUGIN%/*.conf

AskedJuly 10, 2020 - 11:07pm

Answer (1)

Can you paste here the error messages you found?

Comments (8)

  • jdixon's picture

    Not just includes but also inputs.

    Example:
    <Input iis_w3c>
    Module im_file
    File 'C:\inetpub\logs\LogFiles\W3SVC*\u_ex*.log'
    <Exec>
    if $raw_event =~ /^#/ drop();
    else
    {
    csv_w3c_parser->parse_csv();
    $EventTime = parsedate($date + "T" + $time + ".000Z");
    }
    </Exec>
    </Input>

    Error:
    2020-07-16 13:03:31 ERROR failed to open directory: C:\inetpub\logs\LogFiles\W3SVC*: The filename, directory name, or volume label syntax is incorrect.
    2020-07-16 13:03:31 ERROR failed to open directory: C:\inetpub\logs\LogFiles\W3SVC*: The filename, directory name, or volume label syntax is incorrect.

    But the directories do work. They are W3SVC1 and W3SVC2

  • jdixon's picture

    Also I found the problem on the INCLUDES.

    This works:
    include %ROOT%\additional\nxlog_*.conf

    This doesn't work:
    include %ROOT%\additional\*.conf

  • Arkadiy's picture
    (NXLog)

    Hello,

    Second INCLUDE directive don't work because of unescaped character \.
    Regarding files - could you please double check that there no errors in the path?

    Regards, Arch

  • jdixon's picture

    ah that makes sense. So I would need to do this:

    include %ROOT%\additional\\*.conf
    or
    include %ROOT%\\additional\\*.conf

    I checked the path and it is legit. There is a W3SVC1 and W3SVC2 folder in c:\inetpub\logs\Logfiles

  • raf's picture
    (NXLog)

    Hi,

    You can't use wildcards with directory names in the CE edition since it's not supported. For file you can use Recursive to obtain a similar effect, however, it seems to not work with include, please check the answer:

    https://nxlog.co/question/2399/multiple-wildcards-path-logfile

    and also, refer to the manual.

    One of the other possible solutions would be dynamically generated conf files by an external script, that might be not really elegant - but could work.

    Regards,

    Rafal

  • framold's picture

    You can't use wildcards with directory names in the CE edition since it's not supported.

    Where is this documented? I am not sure if i am looking into the right documentation.

    Thanks, Felix