query kibana logstash through python

Viewed 30

I am trying to query Kibana logstash through python.

In the logstash I would want to get this field json.correlation_id: "{json.correlation_id}"

   query = json.dumps({
                 "query": {
                      "json.correlation_id": "json.correlation_id"
                      }
                    })

        r = requests.get(uri,auth = HTTPBasicAuth(username, 
            password),headers=HEADERS, data=query).json()
              print(r)

but I get an error message {'statusCode': 404, 'error': 'Not Found', 'message': 'Not Found'}

How do I actually write the code to query the logstash?

0 Answers
Related