Sortproblem using the cURL API

Hi!
I'm trying to use the cURL API together with the request library i python and having problems with the parameters for sorting my response isn't affecting the result I'm receving.

The same parameters works fine running the in the dev console in Kibana, but generates a completly different response in my python lambda.

I use elastic search 5.1.

What I'm trying to do is to fetch the last entry and check it's timestamp and compare it to the current time in order to see that data is sent to our cluster.

See code here:
paramters = {
"size": 1,
"sort":
{"@timestamp" : "desc"}
}
response = requests.get(url='https://{name}.{region}.es.amazonaws.com/dss-services-*/_search' ,
params=paramters, auth=auth)

Do you see any obvious errors in my parameters?

Best Regards /Viktor

I don't know much about python but guessing here that if you provide the parameters like this, they end up as url parameters. If looks like you would want to specify a request body instead.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.