its the first time im doing this, so maybe im not doing it the right way.
I have a python program and i need to get the result from the search above, i thought ib doing it thru a json request, do you advice doing this in a diferent way?
I am not sure what sort of logtrail experience people here have, so it's unlikely we will be unable to help with that aspect. You will need to ask the logtrail devs/community if you really want to go that route.
from datetime import datetime
from elasticsearch import Elasticsearch
es = Elasticsearch()
res = es.search(index="filebeat-*", query={"match_all": {}})
print("Got %d Hits:" % res['hits']['total']['value'])
for hit in res['hits']['hits']:
print("%(timestamp)s %(author)s: %(text)s" % hit["_source"])
elasticsearch.exceptions.ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection object at 0x7fe1a2c3c940>: Failed to establish a new connection: [Errno 61] Connection refused) caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7fe1a2c3c940>: Failed to establish a new connection: [Errno 61] Connection refused)
es = Elasticsearch('https://log-viewer.dev/app/logtrail')
print(es)
res = es.search(index="filebeat-*", query={"match_all": {}})
print("Got %d Hits:" % res['hits']['total']['value'])
for hit in res['hits']['hits']:
print("%(timestamp)s %(author)s: %(text)s" % hit["_source"])
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.