make pandas dataframe from elasticsearch

from datetime import datetime
from elasticsearch import Elasticsearch
from pandas import DataFrame, Series
import pandas as pd
import matplotlib.pyplot as plt
es = Elasticsearch(host="192.168.121.252")
res = es.search(index="_all", doc_type='logs', body={"query": {"match_all": {}}}, size=2, fields=('path','@timestamp'))

4
9
Delondi 80 points

                                    # Create a basic ES client
client = Elasticsearch(['url'])

# Search
search = Search(using=client)

results = search.execute()

search_dict = results.hits.hits

results_df = pd.DataFrame(search_dict)

4 (9 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
pandas dataframe to elasticsearch dataframe to elasticsearch python python elasticsearch convert to dataframe pandas to elasticsearch python pandas dataframe to elasticsearch elastic search python dataframe python pandas dataframe to elasticsearch index elasticsearch python tutorial elasticsearch store data comes from python python elasticsearch put example how to define the type of do in elastic search db python elastic search with python python elasticsearch tutorial pull elasticsearch index into python df python elasticsearch es.search elasticsearch python demo elasticsearch python localhost elasticsearch python example implement elasticsearch in python python elasticsearch result to dataframe elastic serach by panadas time elastic search send data python elastic search python example how to push data to elasticsearch python pushing data elasticsearch index python python elasticsearch query to dataframe Python elasticsearch one column different data pull elasticsearch pandas library to implement elastic search in python adding data with python elasticsearch how to put data in elasticsearch in python read elasticsearch data with pandas df to elastic search python elasticsearch example code pandas read elasticsearch search index using python dataframe from elasticsearch How to create pandas dataframe from elasticsearch use leastic search in python es in pygame python elasticsearch example elasticsearch tutorial python indexer elasticsearch tutorial python elasticsearch python tutorial for beginners send data to elasticsearch from python kibana python push pandas data no order make pandas dataframe from elasticsearch
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source