Answers for "make pandas dataframe from elasticsearch"

1

get data from elasticsearch to jupyter

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'))
Posted by: Guest on September-15-2020
0

make pandas dataframe from elasticsearch

# 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)
Posted by: Guest on September-15-2020

Code answers related to "make pandas dataframe from elasticsearch"

Python Answers by Framework

Browse Popular Code Answers by Language