I'm trying to design a custom button on my dashboard that will make a watch for a specific query. Going into the API and editing watches based off of data I have in the dashboard is a bit slow and I'm in the process of trying to just create a simple button that the user will enter the Error they would like to set a watch for and press send.
I'm now just trying to make a POST work for a simple index and I can't get it to work and I'm wondering if there is anything in ES stopping me from doing it or if anyone has any suggestions. Here is what I've written thus far:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$.post("172.28.97.54:9200/customer/external?pretty",
{
"name": "Jane Doe"
},
function(data,status){
alert("Data: " + data + "\nStatus: " + status);
});
});
});
</script>
</head>
<body>
<button>Send an HTTP POST request to a page and get the result back</button>
</body>
</html>