3
responses

I am trying to read in logs stored in a flat file from an application and the output is adding a space between every characterI've change my patch to the local windows firewall log and I do not get this problem but I can see nothing strange with the source file

define ROOT C:\Program Files (x86)\nxlog

Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
SpoolDir %ROOT%\data
LogFile %ROOT%\data\nxlog.log


<Extension json>
  Module      xm_json
</Extension>

<Extension syslog>
  Module      xm_syslog
</Extension>


<Input Lenel>
   Module   im_file
File 'C:\Program Files (x86)\program\logs\Dataexchange.log'
   SavePos  TRUE
   Recursive TRUE
   Exec $Message = $raw_event;
   Exec $Hostname = hostname_fqdn();

</input>

<Output local>
  Module      om_file

  File        'c:\_nxlog.txt'

</Output>

<Route test>
 Path test => local
</Route>
AskedDecember 15, 2017 - 10:31pm

Answer (1)

What's the encoding of the source file? This could be caused by UTF16/UCS2. If that's the case see xm_charconv.

Comments (2)

  • gwhitt's picture

    Added the following to make it work.

    <Extension _charconv>
        Module      xm_charconv
        AutodetectCharsets iso8859-2, utf-8, utf-16, utf-32
    </Extension>
    

    added this to the end of my input block

    Exec    $raw_event = convert($raw_event, 'UCS-2LE','UTF-8'); if $raw_event == '' drop();