# Jdbc input - how to trigger immediately after pipeline is started / reloaded?

**URL:** <https://discuss.elastic.co/t/jdbc-input-how-to-trigger-immediately-after-pipeline-is-started-reloaded/163867>\
**Category:** Logstash\
**Created:** [January 11, 2019, 8:34am UTC](https://discuss.elastic.co/t/jdbc-input-how-to-trigger-immediately-after-pipeline-is-started-reloaded/163867 "2019-01-11T08:34:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [January 11, 2019, 8:34am UTC](https://discuss.elastic.co/t/jdbc-input-how-to-trigger-immediately-after-pipeline-is-started-reloaded/163867/1 "2019-01-11T08:34:50Z")

</div>

Hi,

I am currently inplementing a logstash pipeline which is using jdbc input plugin.  
Is there any way that logstash starts the jdbc input query immediately after the pipeline has been started or reloaded?

When I do a change of the pipeline config during developement, it is just so inefficient if you always have to wait until the next minute change.

Thanks, Andreas

---

<div class="post-metadata">

**Author:** ![Chris\_Lyons](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_lyons/32/48107_2.png) [@Chris\_Lyons](https://discuss.elastic.co/u/Chris_Lyons)\
**Post date:** [January 12, 2019, 12:36am UTC](https://discuss.elastic.co/t/jdbc-input-how-to-trigger-immediately-after-pipeline-is-started-reloaded/163867/2 "2019-01-12T00:36:06Z")

</div>

What does your config look like? If you don't provide a schedule it should start as soon as the process spins up...

---

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [January 14, 2019, 2:43pm UTC](https://discuss.elastic.co/t/jdbc-input-how-to-trigger-immediately-after-pipeline-is-started-reloaded/163867/3 "2019-01-14T14:43:30Z")

</div>

I defined it by once a minute:

```
	jdbc_driver_library => "${ORA_JDBC_LIB_PATH}"
	jdbc_driver_class => "Java::oracle.jdbc.OracleDriver"
	
	jdbc_connection_string => "${JDBC_AMES_CONNECT_STRING}"
	jdbc_user => "${JDBC_AMES_USER}"
	jdbc_password => "${JDBC_AMES_PW}"
	add_field => { "stage" => "${STAGE}" }
	add_field => { "hostName" => "${DB_HOSTNAME}" }
		
	jdbc_validate_connection => true
	statement => 
		"
			here comes the statement

		"
			
	schedule => "* * * * *"

```

If I do not provide a schedule, does it run then only once?

---

<div class="post-metadata">

**Author:** ![Chris\_Lyons](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_lyons/32/48107_2.png) [@Chris\_Lyons](https://discuss.elastic.co/u/Chris_Lyons)\
**Post date:** [January 14, 2019, 3:00pm UTC](https://discuss.elastic.co/t/jdbc-input-how-to-trigger-immediately-after-pipeline-is-started-reloaded/163867/4 "2019-01-14T15:00:13Z")

</div>

I have not messed with it in a while but I believe you need to specify:

> last\_run\_metadata\_path =\> "/etc/logstash/jdbc/.logstash\_jdbc\_last\_run"

Don't worry about the path I have, you can define your own just make sure Logstash can write to the file. With this in place and no schedule the pipeline will run until the query is finished, then terminate...

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 11, 2019, 3:00pm UTC](https://discuss.elastic.co/t/jdbc-input-how-to-trigger-immediately-after-pipeline-is-started-reloaded/163867/5 "2019-02-11T15:00:22Z")

</div>

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