Logstash 5.2 | Wanted to call jdbc statement(query) only when some external service/event hit to logstash like JMS

I am stuck in logstash input JDBC plugin. I am new to elasticsearch and I wanted to load data from database to elaststcsearch index using logstash.
1st time I have successfully loaded database data into to elasticsearch index but when I run the update_script.conf for update the index. For that, I have written schedule statement in update_script.conf file.
After every 5 seconds, It will hit to the database query and check if is there any update record available in the database then it will fetch data from the database and update/create the record in elasticsearch index. I have written below input code for that.

input { 
    jdbc { 
        jdbc_driver_library => "../../jt400.jar" 
        jdbc_driver_class => "com.ibm.as400.access.AS400JDBCDriver" 
        jdbc_connection_string => "jdbc:as400://X.X.X.X/zdbxabf005" 
        jdbc_user => "XXXXX" 
        jdbc_password => "XXXXXX"  
        type => "component"
        schedule => "*/5 * * * * *"
        statement =>"Database QUERY" 
  } 
} 

Above script is making an unwanted call even the record is not updated in the database for every 5 seconds, I don't want to make unwanted call DB statement for every 5 seconds. I wanted to call DB statements only when the record is updated in DB. for that we have written some JMS code in java application. Whenever a record is updated in the database JMS will send some events to logstash plugin (I don't know how to accept or identify this JMS external event in logstash).

I also wanted to know how to accept json data using JMS plugin.
Could you please help me for the same.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.