# Pull new enteries from distributed Cassandra database

**URL:** <https://discuss.elastic.co/t/pull-new-enteries-from-distributed-cassandra-database/87913>\
**Category:** Logstash\
**Created:** [June 1, 2017, 1:21pm UTC](https://discuss.elastic.co/t/pull-new-enteries-from-distributed-cassandra-database/87913 "2017-06-01T13:21:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ayush1](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@ayush1](https://discuss.elastic.co/u/ayush1)\
**Post date:** [June 1, 2017, 1:21pm UTC](https://discuss.elastic.co/t/pull-new-enteries-from-distributed-cassandra-database/87913/1 "2017-06-01T13:21:59Z")

</div>

Hi all,

I'm trying to setup Logstash to continuously pull information from Cassandra, in the same fashion it works with file inputs. I'm using the Cassandra JDBC Driver74 and I can successfully pull the contents. But like sql I can not use last value parameter to pull latest value. So after running the query once I wanted to pull only new entries.  
Here is my current config:

input {  
jdbc {  
jdbc\_connection\_string =\> "jdbc:cassandra://hostname:9160"  
schedule =\> "\* \* \* \* \*"  
jdbc\_user =\> "cassandra"  
jdbc\_password =\> "cassandra"  
jdbc\_driver\_library =\> "$PATH/cassandra\_driver.jar"  
jdbc\_driver\_class =\> "com.dbschema.CassandraJdbcDriver"  
statement =\> "SELECT \* FROM table\_decision"  
}  
}

output {  
elasticsearch{  
hosts =\> ["localhost"]  
document\_id =\> "%{index\_pk}"  
index =\> "logstash-2017-01-03"

```
}

```

stdout {  
codec =\> json\_lines  
}  
}

I am using ELK to view logs in real time that are published in Cassandra database. So I am able to view them but as the size of the tables goes to millions I face latency. docement\_id helps me to avoid duplicate data but whenever I am deleting all the documents in that index, logstash again pull the entire table. So is there anyway to pull only new entries.

---

<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, 2017, 1:22pm UTC](https://discuss.elastic.co/t/pull-new-enteries-from-distributed-cassandra-database/87913/2 "2017-06-29T13:22:03Z")

</div>

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