# JDBC through a SSH tunnel

**URL:** <https://discuss.elastic.co/t/jdbc-through-a-ssh-tunnel/254341>\
**Category:** Logstash\
**Created:** [November 5, 2020, 1:25am UTC](https://discuss.elastic.co/t/jdbc-through-a-ssh-tunnel/254341 "2020-11-05T01:25:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElasticLiver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticliver/32/64869_2.png) [@ElasticLiver](https://discuss.elastic.co/u/ElasticLiver)\
**Post date:** [November 5, 2020, 1:25am UTC](https://discuss.elastic.co/t/jdbc-through-a-ssh-tunnel/254341/1 "2020-11-05T01:25:05Z")

</div>

Im getting data from a PostgreSQL DB through an SSH tunnel:

```
autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -L 9999:localhost:5432 root@mypostgresip

```

The data is requested using Logstash JDBC pointing to localhost:

```
jdbc_connection_string => "jdbc:postgresql://127.0.0.1:9999/nnm"

```

The JDBC query runs every 2 minutes

The problem that I have is that the data transmition only last for a little while, then the `last_value` get stuck and never advances. The connection is alive, but no data is coming through.

any ideas on what is going on?

---

<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:** [December 3, 2020, 1:25am UTC](https://discuss.elastic.co/t/jdbc-through-a-ssh-tunnel/254341/2 "2020-12-03T01:25:06Z")

</div>

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