0

I want to send all logs from Database [Table creation, row insertion, data deletion, data selection etc.. ] to Logstash using NXLog, I have read the following blogs,

  1. Nxlog im_dbi is not working
  2. https://groups.google.com/forum/#!topic/logstash-users/t71AkNH5Ojc

But which seams to be not working for me. Any help will be highly appreciable.

My nxlog config file :

<Input sql-logs>        
    Module im_dbi
    SavePos TRUE
    Driver mysql
    Option dbname MySample
</Input>

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

In logstash config file,

tcp {
    port => 5222
    type => "sqllogs"
}

Then I have created new table, inserted many records, but no logs visible in kibana.

Community
  • 1
  • 1
Gunaseelan
  • 14,415
  • 11
  • 80
  • 128
  • I recommend you add some examples of config files you have tried to use to your question, and any errors you get, or what is not working – Rumbles Dec 17 '14 at 11:20
  • @Rumbles I have updated – Gunaseelan Dec 17 '14 at 13:15
  • Please post your entire logstash config file. The fragment of the input stanza you posted won't help us debug the output. – Alain Collins Dec 18 '14 at 06:06
  • For more debugging advice, check out this page: http://svops.com/blog/?p=26 – Alain Collins Dec 18 '14 at 06:07
  • I have asked new question regards this in [SO](http://stackoverflow.com/questions/27543568/parse-sql-log-from-log-file-using-logstash), Please take a look @Rumbles – Gunaseelan Dec 18 '14 at 09:54
  • @AlainCollins I have asked new question regards this in [SO](http://stackoverflow.com/questions/27543568/parse-sql-log-from-log-file-using-logstash), Please take a look. – Gunaseelan Dec 18 '14 at 09:55
  • @Rumbles Can you please see [this](http://stackoverflow.com/questions/27563109/message-missing-in-nxlog-log-shipping) question too? – Gunaseelan Dec 19 '14 at 12:08
  • @AlainCollins Can you please see [this](http://stackoverflow.com/questions/27563109/message-missing-in-nxlog-log-shipping) question too? – Gunaseelan Dec 19 '14 at 12:09

1 Answers1

0

You should first debug whether the sql-logs input actually works. I don't think it does. Check nxlog.log There is an SQL directive which specifies the select statement:

<Input sql-logs>        
    Module im_dbi
    SavePos TRUE
    Driver mysql
    Option dbname MySample
    SQL SELECT a, b as id FROM tbl
</Input>

Note that an id column must be present in the result set.

b0ti
  • 2,319
  • 1
  • 18
  • 18