<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title><![CDATA[Ashish Tiwari - Elasticsearch Labs]]></title>
    <description><![CDATA[Articles and tutorials from the Search team at Elastic]]></description>
    <copyright><![CDATA[© 2026. Elasticsearch B.V. All Rights Reserved]]></copyright>
    <image>
      <title><![CDATA[Ashish Tiwari - Elasticsearch Labs]]></title>
      <url>https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt1121c0bf0e8a6e65/6a88da6340a1841030ef456f/search-labs-thumbnail.png</url>
      <link>https://www.elastic.co/search-labs/author/ashish-tiwari</link>
    </image>
    <link>https://www.elastic.co/search-labs/author/ashish-tiwari</link>
    <atom:link href="https://www.elastic.co/search-labs/rss/author/ashish-tiwari.xml" rel="self" type="application/rss+xml"/>
    <language><![CDATA[en]]></language>
    <lastBuildDate>Sun, 20 Sep 2026 06:01:28 GMT</lastBuildDate>
  <item>
    <title><![CDATA[How to ingest data from Snowflake to Elasticsearch]]></title>
    <description><![CDATA[Learn how to ingest data from Snowflake to Elasticsearch using Logstash or a Snowflake Elasticsearch Python Script.]]></description>
    <content:encoded><![CDATA[<p>To take advantage of the powerful search capabilities offered by Elasticsearch, many businesses keep a copy of searchable data in Elasticsearch. Elasticsearch is a scalable data store and vector database, proven for traditional text search and vector search in semantic search use cases. The Elasticsearch Relevance Engine</p><p>TM (ESRE) enables you to add semantic search on proprietary data that can be integrated with generative AI technologies to build modern search experiences.</p><p></p><p><a href="https://www.snowflake.com/">Snowflake</a> is a fully managed SaaS (software as a service) that provides a single platform for data warehousing, data lakes, data engineering, data science, data application development, and secure sharing and consumption of real-time/shared data.</p><p>In this blog, we will see how to bring your snowflake data to Elasticsearch using below methods:</p><ol><li><p>Using <a href="https://www.elastic.co/logstash">Logstash</a> (periodic sync)</p></li><li><p>Using <a href="https://github.com/ashishtiwari1993/snowflake-elasticsearch-connector">Snowflake Elasticsearch Python Script</a> (one time sync)</p></li></ol><h2>Prerequisites</h2><h3>Snowflake credentials</h3><p>You will have received all below credentials after <a href="https://signup.snowflake.com/">signup</a>, or you can get them from the Snowflake panel.</p><ul><li><p>Account username</p></li><li><p>Account password</p></li><li><p>Account Identifier</p></li></ul><h3>Elastic credentials</h3><ol><li><p>Visit <a href="https://cloud.elastic.co/registration?onboarding_token=search&amp;cta=cloud-registration&amp;tech=trial&amp;plcmt=article%20content&amp;pg=search-labs">https://cloud.elastic.co</a> and sign up.</p></li><li><p>Click on <strong>Create deployment</strong>. In the pop-up, you can change the settings or keep the default settings.</p></li><li><p>Download or copy the deployment credentials (both username and password).</p></li><li><p>Also copy the <a href="https://www.elastic.co/guide/en/cloud/current/ec-cloud-id.html">Cloud ID</a>.</p></li><li><p>Once you’re ready for deployment, click on <strong>Continue</strong> (or click on <strong>Open Kibana</strong>). It will redirect you to the Kibana dashboard.</p></li></ol><h2>Methods to ingest data from Snowflake to Elasticsearch</h2><h3>Method 1: Using Logstash</h3><p>Logstash is an open source ETL tool where you can provide multiple sources as an input, transform (modify) it, and push to your favorite stash. One of the famous use cases of Logstash is reading logs from the file and pushing to Elasticsearch. We can also modify the data on the fly using a <a href="https://www.elastic.co/guide/en/logstash/current/filter-plugins.html">filter</a> plugin, and it will push updated data to the output.</p><p>We’re going to use the <a href="https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html">JDBC input plugin</a> to pull the data from Snowflake and push to Elasticsearch using the <a href="https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html">Elasticsearch output plugin</a>.</p><ol><li><p>Install Logstash by referring to the <a href="https://www.elastic.co/guide/en/logstash/current/installing-logstash.html">documentation</a>.</p></li><li><p>Go to the Maven Central Repository and download: <a href="https://repo1.maven.org/maven2/net/snowflake/snowflake-jdbc">https://repo1.maven.org/maven2/net/snowflake/snowflake-jdbc</a>.</p></li><li><p>Click on the directory for the version that you need and download the <strong>snowflake-jdbc-#.#.#.jar</strong> file. In my case, I have downloaded <code>snowflake-jdbc-3.9.2.jar</code>. (Refer to official documentation to learn more about the <a href="https://docs.snowflake.com/en/developer-guide/jdbc/jdbc">Snowflake JDBC Driver</a>.)</p></li><li><p>Create a pipeline by creating file <code>sf-es.conf</code>. Add the below snippet and replace all credentials.</p></li></ol>input {
  jdbc {
    jdbc_driver_library =&gt; "/usr/share/logstash/logstash_external_configs/driver/snowflake-jdbc-3.9.2.jar"
    jdbc_driver_class =&gt; "net.snowflake.client.jdbc.SnowflakeDriver"
    jdbc_connection_string =&gt; "jdbc:snowflake://&lt;account_identifier&gt;.snowflakecomputing.com/?db=SNOWFLAKE_SAMPLE_DATA&amp;warehouse=COMPUTE_WH&amp;schema=TPCH_SF1"
    jdbc_user =&gt; "&lt;snowflake_username&gt;"
    jdbc_password =&gt; "&lt;snowflake_password&gt;"
    schedule =&gt; "* * * * *"
    statement =&gt; "select * from customer limit 10;"
  }
}

filter {}

output {
  elasticsearch {
    cloud_id =&gt; "&lt;elastic cloud_id&gt;"
    cloud_auth =&gt; "&lt;elastic_username&gt;:&lt;elastic_password&gt;"
    index =&gt; "sf_customer"
  }
}
<p><strong>jdbc_connection_string</strong> :</p>db=SNOWFLAKE_SAMPLE_DATA
warehouse=COMPUTE_WH
schema=TPCH_SF1
<p><strong>Schedule:</strong> Here you can schedule to run this flow periodically using cron syntax. On every run, your data will be moved incrementally. You can check more on <a href="https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#_scheduling_2">scheduling</a>.</p><p>Please change according to your requirements.</p><p><a href="https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#plugins-inputs-jdbc-jdbc_paging_enabled"><strong>JDBC Paging</strong></a> <strong>(Optional):</strong> This will cause a sql statement to be broken up into multiple queries. Each query will use limits and offsets to collectively retrieve the full result-set. You can use this to move all data in a single run.</p><p>Enable JDBC paging by adding below configurations:</p>jdbc_paging_enabled =&gt; true,
jdbc_paging_mode =&gt; "explicit",
jdbc_page_size =&gt; 100000

<ol><li><p>Run Logstash</p></li></ol>bin/logstash -f sf-es.conf
<h3>Method 2: Using Snowflake-Elasticsearch Python script</h3><p>If Logstash is not currently in place or has not been implemented, I have written a small Python utility, which is available <a href="https://github.com/ashishtiwari1993/snowflake-elasticsearch-connector">here on GitHub</a>, to pull data from Snowflake and push it to Elasticsearch. This will pull all your data at one time. So if you have a small amount of data to be migrated in a non-periodic manner, you can use this utility.</p><p><strong>Note:</strong> This is not a part of the official <a href="https://www.elastic.co/guide/en/enterprise-search/current/connectors.html">Elastic connectors</a>. Elastic connectors provide support for various data sources. You can use this connector if you have a requirement to sync data from any supported data sources.</p><ol><li><p>Installation</p></li></ol>git clone https://github.com/ashishtiwari1993/snowflake-elasticsearch-connector.git
cd snowflake-elasticsearch-connector
<ol><li><p>Installing dependencies</p></li></ol>pip install -r requirements.txt
<ol><li><p>Change configs</p></li></ol><ul><li><p>Open <code>config/connector.yml</code>.</p></li><li><p>Replace credentials with the following:</p></li></ul>snowflake:
  username: &lt;sf_username&gt;
  password: &lt;sf_password&gt;
  account: &lt;sf_account_identifier&gt;
  database: &lt;db_name&gt;
  table: &lt;table_name&gt;
  columns: ""
  warehouse: ""
  scheme: ""
  limit: 50

elasticsearch:
  host: https://localhost:9200
  username: elastic
  password: elastic@123
  ca_cert: /path/to/elasticsearch/config/certs/http_ca.crt
  index: &lt;sf_customer&gt;

<ol><li><p>Run connector</p></li></ol>python __main__.py
<img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt3056444664f99151/6a170b39ab7f08e6a0db9ea0/26faefb842a5d9af87d659c763adb79207980dc8-1475x582.gif" alt="Snowflake to Elasticsearch python script" /><h2>Verify data</h2><ol><li><p>Log in to Kibana and go to <strong>☰ &gt; Management &gt; Dev Tools</strong>.</p></li><li><p>Copy and paste the following API GET request into the Console pane, and then click the ▶ (play) button. This queries all records in the new index.</p></li></ol>GET sf_customer/_search
{
  "query": {
    "match_all": {}
  }
}

<img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltceca98d9be170ff7/6a170b3b0c485744e701aa9a/e45399d16b795dbb936f95615e69590d2e6882dd-1440x697.png" alt="Output snowflake to elasticsearch" /><h2>Conclusion</h2><p>We have successfully migrated the data from Snowflake to Elastic Cloud. You can achieve the same on any Elasticsearch instance, whether it is in the cloud or on prem.</p><p>Start leveraging full text and <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/semantic-search.html">semantic search capabilities</a> on your data set. You can also connect your data with LLMs to build <a href="https://www.elastic.co/search-labs/chatgpt-elasticsearch-openai-meets-private-data">Question - Answer</a> capabilities.</p>]]></content:encoded>
    <link>https://www.elastic.co/search-labs/blog/ingest-data-from-snowflake-to-elasticsearch</link>
    <guid isPermaLink="true">https://www.elastic.co/search-labs/blog/ingest-data-from-snowflake-to-elasticsearch</guid>
    <category><![CDATA[Index Data]]></category>
    <dc:creator><![CDATA[Ashish Tiwari]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltac4b4ee213b421df/6a170b3c2867145fc693e31f/863d959e4481788dac10ed6abad63de2e823f2d0-1440x810.jpg" length="0" type="image/jpeg"/>
    <pubDate>Wed, 20 Dec 2023 00:00:00 GMT</pubDate>
  </item>
  </channel>
</rss>