2
responses

define ROOT C:\\Program Files (x86)\\nxlog
define ROOT_STRING C:\\Program Files (x86)\\nxlog
define CERTDIR %ROOT%\\cert
Moduledir %ROOT%\\modules
CacheDir %ROOT%\\data
Pidfile %ROOT%\\data\\nxlog.pid
SpoolDir %ROOT%\\data
LogFile %ROOT%\\data\\nxlog.log
<Extension charconv>
Module xm_charconv
AutodetectCharsets utf-8, euc-jp, utf-16, utf-32, iso8859-2
</Extension>
<Extension fileop>
Module xm_fileop
</Extension>
<Input im_file>
Module im_file
File "C:\\inetpub\\vhost\\Auth\\logs\\nlog-test.log"
SavePos TRUE
Exec $raw_event = '[xxxxxxxxxxxxxxxxxxx]' + $raw_event;
Exec $Message = $raw_event;
</Input>

<Output out>
Module om_tcp
Host listener.logz.io
Port 8010
</Output>

<Route route>
Path im_file => out
</Route>

AskedApril 8, 2019 - 8:37am

Answer (1)

Hello,

You can try this first::

1. I would advise using single quotes for input file: File 'C:\\inetpub\\vhost\\Auth\\logs\\nlog-test.log' (you can read about it here https://nxlog.co/docs/nxlog-ce/nxlog-reference-manual.html#im_file)
2. Change SavePos TRUE to FALSE (for testing, specially if logs aren't generated often). I also add ReadFromLast FALSE (not sure if it's necessary)
3. Change output to om_file and save it locally, so you can check fast if you are receiving data.

Let me know the results, I can try to help you more :)

Regards,
Asta

Comments (1)

  • manzur.shaikh's picture

    so final config looks like below -

    define ROOT C:\\Program Files (x86)\\nxlog
    define ROOT_STRING C:\\Program Files (x86)\\nxlog
    define CERTDIR %ROOT%\\cert
    Moduledir %ROOT%\\modules
    CacheDir %ROOT%\\data
    Pidfile %ROOT%\\data\\nxlog.pid
    SpoolDir %ROOT%\\data
    LogFile %ROOT%\\data\\nxlog.log
    <Extension charconv>
    Module xm_charconv
    AutodetectCharsets utf-8, euc-jp, utf-16, utf-32, iso8859-2
    </Extension>
    <Input messages>
    Module im_file
    File "C:\inetpub\vhost\Auth\logs\nlog*.log"
    Exec $Message = '[xxxxxxxxxxxxxxx]' +$raw_event;
    </Input>

    <Output tcp>
    Module om_tcp
    Host listener.logz.io
    Port 8010
    </Output>

    <Route messages_to_tcp>
    Path messages => tcp
    </Route>