Parse sql log from log file using logstash

2.2k views Asked by At

I want to read MSSQL logs from log file, Written the NXLOG code as following,

<Input sql-logs>
    Module      im_file
    File 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Log\ERRORLOG*'
    ReadFromLast TRUE
    Exec        if $raw_event =~ /^#/ drop();                    \
                else                                             \
                {                                                \
                    sql->parse_csv();                            \
                    #$EventTime = parsedate($date + " " + $time); \
                    to_json ();                                  \
                }
</Input>

Where module SQL is,

<Extension sql>      
    Module      xm_csv
    Fields      $date, $time, $hostname, $message
    FieldTypes  string, string, string, string
    Delimiter   ' '
</Extension>

And Output configuration is,

<Output sql-out>
    Module      om_tcp
    Host        192.168.1.14
    Port        5222
</Output>

I have uploaded sample file in box, You can open the file using chrome, There is no error message in both NXLOG and Logstash, But I couldn't see the output.

I mean there is no data received from this file.

0

There are 0 answers