# CosmosDB configuration

**URL:** <https://discuss.elastic.co/t/cosmosdb-configuration/213997>\
**Category:** Logstash\
**Created:** [January 7, 2020, 7:43am UTC](https://discuss.elastic.co/t/cosmosdb-configuration/213997 "2020-01-07T07:43:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Croos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/croos/32/29489_2.png) [@Croos](https://discuss.elastic.co/u/Croos)\
**Post date:** [January 7, 2020, 7:43am UTC](https://discuss.elastic.co/t/cosmosdb-configuration/213997/1 "2020-01-07T07:43:50Z")

</div>

Hi,  
Currently, I have the following config file for logstash.

```
input {
  jdbc {
	  #https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#plugins-inputs-jdbc-record_last_run
    jdbc_connection_string => "jdbc:sqlserver://localhost:1433;database=CatalogDb;user=croos;password=12345"
    jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"    
    jdbc_user => nil
    # The path to our downloaded jdbc driver
    jdbc_driver_library => "C:\Program Files (x86)\sqljdbc6.2\enu\sqljdbc4-3.0.jar"
    # The name of the driver class for SqlServer
    jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
    # Query for testing purpose		
    schedule => "* * * * *"
    #last_run_metadata_path => "C:\Software\ElasticSearch\logstash-6.4.0\.logstash_jdbc_last_run"
    #record_last_run => true
    #clean_run => true
    statement => " select * from Todos"		
  }
}

output {
  elasticsearch {
    hosts => ["localhost:9200"]
    index => "croos_test"
    #document_id is a unique id, this has to be provided during syn, else we may get duplicate entry in ElasticSearch index.
    document_id => "%{id}"
  }

  stdout { 
    codec => rubydebug 
  }
}

```

Now I planed to replace Azure cosmos DB for SqlServer. Any sample configuration for CosmosDB connection?

---

<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 4, 2020, 7:55am UTC](https://discuss.elastic.co/t/cosmosdb-configuration/213997/2 "2020-02-04T07:55:12Z")

</div>

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