【报错】解决logstash tracking_column not found in dataset. {:tracking_column=>"updated_time"}问题

  今天用logstash同步数据库记录到elasticsearch时候出现错误,错误信息如下:

[2019-10-12T23:51:00,529][WARN ][logstash.inputs.jdbc     ] tracking_column not found in dataset. {:tracking_column=>"updated_time"}
{ 2018 rufus-scheduler intercepted an error:
  2018   job:
  2018     Rufus::Scheduler::CronJob "* * * * *" {}
  2018   error:
  2018     2018
  2018     TypeError
  2018     can‘t dup NilClass
  2018       org/jruby/RubyKernel.java:1882:in `dup‘
  2018       uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/date/format.rb:838:in `_parse‘
  2018       uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/date.rb:1830:in `parse‘
  2018       /usr/local/logstash-6.4.3/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/value_tracking.rb:87:in `set_value‘
  2018       /usr/local/logstash-6.4.3/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:237:in `execute_statement‘
  2018       /usr/local/logstash-6.4.3/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:277:in `execute_query‘
  2018       /usr/local/logstash-6.4.3/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:258:in `block in run‘
  2018       /usr/local/logstash-6.4.3/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:234:in `do_call‘
  2018       /usr/local/logstash-6.4.3/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:258:in `do_trigger‘
  2018       /usr/local/logstash-6.4.3/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:300:in `block in start_work_thread‘
  2018       /usr/local/logstash-6.4.3/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:299:in `block in start_work_thread‘
  2018       org/jruby/RubyKernel.java:1292:in `loop‘
  2018       /usr/local/logstash-6.4.3/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:289:in `block in start_work_thread‘
  2018   tz:
  2018     ENV[‘TZ‘]:
  2018     Time.now: 2019-10-12 23:51:00 +0800
  2018   scheduler:
  2018     object_id: 2008
  2018     opts:
  2018       {:max_work_threads=>1}
  2018       frequency: 0.3
  2018       scheduler_lock: #<Rufus::Scheduler::NullLock:0x5f5e76bc>
  2018       trigger_lock: #<Rufus::Scheduler::NullLock:0x707e50a2>
  2018     uptime: 242.19924699999999 (4m2s199)
  2018     down?: false
  2018     threads: 2
  2018       thread: #<Thread:0x76e69139>
  2018       thread_key: rufus_scheduler_2008
  2018       work_threads: 1
  2018         active: 1
  2018         vacant: 0
  2018         max_work_threads: 1
  2018       mutexes: {}
  2018     jobs: 1
  2018       at_jobs: 0
  2018       in_jobs: 0
  2018       every_jobs: 0
  2018       interval_jobs: 0
  2018       cron_jobs: 1
  2018     running_jobs: 1
  2018     work_queue: 0

  

这种错误会导致创建不了时间节点文件。

问题原因是由于我的conf 中sql是多表联查的,我给每个字段起了别名(驼峰方式),但是logstash里面不支持驼峰字段,所以将字段别名全部用了小写,之后就好了,以下附上本人的conf文件

input {
  jdbc {
    jdbc_driver_library => "/usr/local/sql/mysql-connector-java-5.1.46.jar"
    jdbc_driver_class => "com.mysql.jdbc.Driver"
    jdbc_connection_string => "jdbc:mysql://XXXX/test"
    jdbc_user => "xxxx"
    jdbc_password => "xxxx"
    schedule => "* * * * *"
    statement => "SELECT p.product_id productid, p. NAME, p.title, p.description, pc.product_category_name productCategoryName, pc.product_category_describe productCategoryDescribe, ppc.price_category_name priceCategoryName, ppc.price_category_describe priceCategoryDescribe, pp.price, p.created_by createdBy, p.created_time createdTime, p.updated_by updatedBy, p.updated_time updatedtime FROM product p LEFT JOIN product_price pp ON p.product_id = pp.product_id LEFT JOIN product_category pc ON p.category_id = pc.product_category_id LEFT JOIN product_price_category ppc ON pp.price_category_id = ppc.price_category_id WHERE p.updated_time >= :sql_last_value"
    use_column_value => true
    tracking_column_type => "timestamp"
    tracking_column => "updatedtime"
    last_run_metadata_path => "syncpoint_product"
  }
}

output {
    elasticsearch {
        # ES的IP地址及端口
        hosts => ["172.31.70.140:9200","172.31.70.140:9201"]
        # 索引名称 可自定义
        index => "product"
        # 需要关联的数据库中有有一个id字段,对应类型中的id
        document_id => "%{productid}"
        document_type => "product"
    }
    stdout {
        # JSON格式输出
        codec => json_lines
    }
}

  

本次整理希望能帮助大家。

原文地址:https://www.cnblogs.com/wbl001/p/11664531.html

时间: 2024-10-22 09:19:30

【报错】解决logstash tracking_column not found in dataset. {:tracking_column=>"updated_time"}问题的相关文章

Oracle11g 启动报错ORA-00845: MEMORY_TARGET not supported on this system报错解决

ORA-00845: MEMORY_TARGET not supported on this system报错解决 Oracle启动报错 ORA-00845: MEMORY_TARGET not supported on this system报错解决 SQL> startup ORA-00845: MEMORY_TARGET not supported on this system 查看原本大小 [[email protected] oracle]# df -h|grep shm tmpfs

【Unity3D】生成工程报错解决—UnityEditor.HostView:OnGUI() Error building Player: Couldn&#39;t build player because of unsupported data on target platform.

错误 错误1:An asset is marked as dont save, but is included in the build: unityEditor.HostView:OnGUI() 错误2:Building - Failed to write file: sharedassets0.assetsUnityEditor.HostView:OnGUI() 错误3:Error building Player: Couldn't build player because of unsup

quick3.3final版创建项目报错解决

quick3.3final版创建项目报错解决 今天新下载了quick3.3final版,于是安装,创建项目,打开player新建项目如下图 然后点击创建,就发生了如下错误,相信应该有不少朋友会碰到的 首先,这里有两个错误 1.PHP Notice:  Undefined index: extracmd in /Users/wangmeng/Documents/quick-3.3/quick/bin/lib/quick/ProjectCreator.php on line 117 这是117行有未

Eclipse @override报错解决

关键字: eclipse @override 报错 解决 第一种解决方案: @Override是JDK5 就已经有了,但有个小小的Bug,就是不支持对接口的实现,认为这不是Override而JDK6 修正了这个Bug,无论是对父类的方法覆盖还是对接口的实现都可以加上@Override 修改你的eclipse指定的编译器版本在选项里的java compiler中指定版本至少在5.0以上 在myEclipse中改变编译器的方法:Project->Properties->Java Compiler-

Android 工程报错解决 Unable to resolve target &#39;android-17&#39;

转自:http://www.cnblogs.com/csulennon/p/3705177.html 换了系统后,重新安装了Android SDK和ADT插件,导入之前的工作空间.居然发现所有的Android工程都报错了. 我之前的SDK版本是用的17,升级后用的是19. 1: [2014-05-03 14:56:25 - ThinkBlink] Unable to resolve target 'android-17' 2: [2014-05-03 14:56:26 - Game2048Pub

PHP多次调用Mysql存储过程报错解决办法

PHP多次调用Mysql数据库的存储过程会出现问题,主要问题为存储过程中执行多次SQL语句不能一一释放导致的,网上找了一些解决办法,比如使用 multi_query 然后一个一个释放,但是发现根本不适合我们的项目,我们使用CI框架写的,更多的是使用CI的数据库处理方法.所以只能另辟蹊径. 一次偶然,把Mysql链接方式改成了mysqli,两种不同的PHP连接mysql的扩展,官方在高版本中推荐使用mysqli,结果却奇迹般好了,使用Mysql长连接也行,天意么? PHP多次调用Mysql存储过程

jsp页面中onsubmit=&quot;return checklogin();&quot;报错解决办法

选择Window->Preferences->MyEclipse->Validation 去掉方框里的对号,然后Apply 然后点击Yes->然后再点击ok->Yes,就好了,如果你打开了那个出现错误jsp页面的话,请关掉重现打开就ok啦 jsp页面中onsubmit="return checklogin();"报错解决办法,布布扣,bubuko.com

dl380G8安装windows 2008R2 报错解决办法。

dl380安装windows2008R2时报错,安装包是我一直在用的安装包.我用光盘.优盘还是ILO安装都是报同样的错误.详细错误如下: 1.在复制完系统后重启安装时报下面的错误.我点击确定后系统会重启. windows cannot read the <productkey>setting from the unattend answer file 2.重启后报下面的错误,然后是不停的重启. 原因:是因为HP Intelligent Provisioning版本1.6都存在这个问题. 解决办

java保存报错解决for column &#39;name&#39; at r

Incorrect string value: '\xE6\x98\xAF\xE6\xBB\xB4...' for column 'name' at r 修改数据库的编码 ALTER DATABASE test CHARACTER SET utf8 ALTER TABLE hobby CONVERT TO CHARACTER SET utf8 ALTER TABLE person CONVERT TO CHARACTER SET utf8 java保存报错解决for column 'name'