Connect to a Elasticsearch cluster from your Streamlit app. Powered by st.experimental_connection()
and Elasticsearch.
pip install streamlit git+https://github.com/sidhulabs/streamlit-elasticsearch-connection
Setup your .streamlit/secrets.toml
. You must specify one of the following:
- hosts
- cloud_id
For auth methods, you must either use:
- a username or password
- api id and api key.
# .streamlit/secrets.toml
[connections.elasticsearch]
cloud_id = "..."
# hosts = "..."
user = "..."
password = "..."
# api_id = "..."
# api_key = "..."
Then in your streamlit script:
# main.py
import streamlit as st
from elasticsearch_connection import ElasticsearchConnection
conn = st.experimental_connection("elasticsearch", type=ElasticsearchConnection)
df = conn.query("kibana_sample_data_flights")
st.dataframe(data)
Does this work for hosted or cloud clusters?
It works for both.