# Can we use stored procedure in logstash using jdbc

**URL:** <https://discuss.elastic.co/t/can-we-use-stored-procedure-in-logstash-using-jdbc/193497>\
**Category:** Logstash\
**Created:** [August 2, 2019, 9:35am UTC](https://discuss.elastic.co/t/can-we-use-stored-procedure-in-logstash-using-jdbc/193497 "2019-08-02T09:35:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![raj.teaser](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@raj.teaser](https://discuss.elastic.co/u/raj.teaser)\
**Post date:** [August 2, 2019, 9:35am UTC](https://discuss.elastic.co/t/can-we-use-stored-procedure-in-logstash-using-jdbc/193497/1 "2019-08-02T09:35:40Z")

</div>

Hi,

Can we use stored procedure in logstash using jdbc? As proc we are executing in oracle for update the data.

You help will be most appreciated.

Thanks & Regards,  
Raj

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [August 2, 2019, 11:19am UTC](https://discuss.elastic.co/t/can-we-use-stored-procedure-in-logstash-using-jdbc/193497/2 "2019-08-02T11:19:53Z")

</div>

Hi,

What DB are you using? I know that for Oracle you can call functions in SQL so you could set the following as statement: "select proc() from dual"

Best regards  
Wolfram

---

<div class="post-metadata">

**Author:** ![raj.teaser](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@raj.teaser](https://discuss.elastic.co/u/raj.teaser)\
**Post date:** [August 7, 2019, 6:22pm UTC](https://discuss.elastic.co/t/can-we-use-stored-procedure-in-logstash-using-jdbc/193497/3 "2019-08-07T18:22:03Z")

</div>

Thank you for your response.

I am using oracle DB. I want to use stored procedure. How can we use in logstash?

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [August 9, 2019, 6:13am UTC](https://discuss.elastic.co/t/can-we-use-stored-procedure-in-logstash-using-jdbc/193497/4 "2019-08-09T06:13:32Z")

</div>

You can create a logstash pipeline with an input block similar to the following:

> ```
> input {
> jdbc {
> jdbc_driver_library => "/home/<user>/logstash/ojdbc6-12.1.0.2.jar"
> jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
> jdbc_connection_string => "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<host>)(PORT=6203))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=P<servicename>)))"
> jdbc_user => "${input.jdbc.jdbc_user}"
> jdbc_password => "${input.jdbc.jdbc_password}"
> jdbc_validate_connection => true
> schedule => "* * * * *"
> statement => "select proc() from dual"
> }
> }
> 
> ```

---

<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:** [September 6, 2019, 6:13am UTC](https://discuss.elastic.co/t/can-we-use-stored-procedure-in-logstash-using-jdbc/193497/5 "2019-09-06T06:13:38Z")

</div>

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