Hi,

the code you have here should work, what do you get when you try:

from elasticsearch import Elasticsearch

es = Elasticsearch("10.120.xx.xxx:6xxx8")
print(es.info())

Thanks

On Thu, Sep 11, 2014 at 11:14 AM, Nimit Jain <[email protected]> wrote:
> Hi All,
> I need I need to call my server xxx.xx.xx.xxx:xxxxx using elasticsearch api
> in python but I am not able to get the proper code to run that. Below is
> that I have done yet.
>
> from datetime import datetime
> from elasticsearch import Elasticsearch
>
> es = Elasticsearch("10.120.xx.xxx:6xxx8")
> print(es.cluster)
> print(es.cat)
> print(es.indices)
> print(es.nodes)
> print(es.snapshot)
>
>
> # but not deserialized
> es.get(index="logstash-2014.09.11", doc_type="syslog",
> id='iFP2D8nHSKeqevBWrm1Hgg')['_source']
> {u'any': u'data', u'timestamp': u'2013-05-12T19:45:31.804229'}
>
> print(es)
>
>
> Please tell me what to do from here so I am doing wrong.
>
> --
> You received this message because you are subscribed to the Google Groups
> "elasticsearch" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/d33976fd-b4ea-4ce3-8e97-cd019b77b0f7%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CABfdDir0PTP%3D%3DW14ikyMk33zBj%3DJgqcfokxZBPiXg8wM8oDFsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to