# Disable logstash logger for inputs.jdbc

**URL:** <https://discuss.elastic.co/t/disable-logstash-logger-for-inputs-jdbc/274526>\
**Category:** Logstash\
**Created:** [May 31, 2021, 2:50pm UTC](https://discuss.elastic.co/t/disable-logstash-logger-for-inputs-jdbc/274526 "2021-05-31T14:50:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris\_ts24](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_ts24/32/79048_2.png) [@chris\_ts24](https://discuss.elastic.co/u/chris_ts24)\
**Post date:** [May 31, 2021, 2:50pm UTC](https://discuss.elastic.co/t/disable-logstash-logger-for-inputs-jdbc/274526/1 "2021-05-31T14:50:49Z")

</div>

Hi all,

I am using Logstash 7.12.1 to update an elasticsearch 7.12.1 index from an oracle database. I have no problem establishing communication with the DB using the below input jdbc declaration:

```auto
input {
   jdbc { 
      jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
      jdbc_driver_library => "<PATH_TO_DRIVER>"
      jdbc_connection_string => "jdbc:oracle:thin:@<IP>:<PORT>/<SERVICE>"
      jdbc_user => "<USER>"
      jdbc_password => "<PASSWORD>"
      statement_filepath => "<update_sql_path>"
      schedule => "* * * * *"
      last_run_metadata_path => "<last_run_path>"
  }
}

```

However, my sql command is very long. As you can maybe tell from the input, this is a scheduled update job, and this long sql command gets written to my log _every time it is run_. This creates extremely large daily logs that are impractical, not only in size, but also as far as readability is concerned; More than 90% of the content is the same SQL command repeated over and over again!

I've attempted changing the "sql\_log\_level", but to no avail. It is still written just under a different log level.

Does anyone perhaps have a solution for this problem?

Best,

Chris

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 31, 2021, 3:08pm UTC](https://discuss.elastic.co/t/disable-logstash-logger-for-inputs-jdbc/274526/2 "2021-05-31T15:08:05Z")

</div>

What message is logged? Is it "Executing JDBC query"?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [May 31, 2021, 4:03pm UTC](https://discuss.elastic.co/t/disable-logstash-logger-for-inputs-jdbc/274526/3 "2021-05-31T16:03:36Z")

</div>

Change the loglevel in logstash.

Your request is something like this:

```auto
curl -XPUT 'localhost:9600/_node/logging?pretty' -H 'Content-Type: application/json' -d'{ "logger.logstash.inputs.jdbc" : "ERROR" }'

```

This will make the inputs.jdbc to log only on ERROR levels.

---

<div class="post-metadata">

**Author:** ![chris\_ts24](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_ts24/32/79048_2.png) [@chris\_ts24](https://discuss.elastic.co/u/chris_ts24)\
**Post date:** [June 1, 2021, 7:09am UTC](https://discuss.elastic.co/t/disable-logstash-logger-for-inputs-jdbc/274526/4 "2021-06-01T07:09:02Z")

</div>

After every query, the SQL string is written to the log. This spans something around 20 lines and makes finding more informative parts of the log, such as what records were updated / deleted / inserted a bit tedious.

---

<div class="post-metadata">

**Author:** ![chris\_ts24](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_ts24/32/79048_2.png) [@chris\_ts24](https://discuss.elastic.co/u/chris_ts24)\
**Post date:** [June 1, 2021, 7:15am UTC](https://discuss.elastic.co/t/disable-logstash-logger-for-inputs-jdbc/274526/5 "2021-06-01T07:15:08Z")

</div>

Thank you! This is what I was going for. I couldn't find this anywhere in the documentation unfortunately. If I missed some references to controlling logger output / setting custom logging behavior, I would appreciate any links you can add here!

For this method to work, I had to start my logstash service first, which started it writing to my log file. Then upon changing the log level to "error", it ceased writing my long sql command. Would it be possible to configure this prior to starting the service? In a sort of config file perhaps?

Ultimately, my goal is to have custom logging to store information regarding what logstash communicates to my ES index. Something in the form of:  
[@timestamp] [LOG\_LEVEL] [logstash.outputs.elasticsearch] "Records (RECORD\_ID) updated/inserted/deleted: =\> List of event keys and values"

---

<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:** [June 29, 2021, 7:15am UTC](https://discuss.elastic.co/t/disable-logstash-logger-for-inputs-jdbc/274526/6 "2021-06-29T07:15:50Z")

</div>

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