Parse sql log from log file using logstash

≡放荡痞女 提交于 2019-12-11 17:41:07

问题


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.

来源:https://stackoverflow.com/questions/27543568/parse-sql-log-from-log-file-using-logstash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!