I'm trying to post some json data on Kibana dashboard using ELK containers but I'm getting the error XMLHttpRequest cannot load myUrl. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. Despite the error, it displays data on Kibana dashboard as the whole json in one string as "message=test", where it must have been only "test".
It is also giving me "failure" alert all the time even though my misparsed json data is sent correctly and displayed on Kibana.
My function is
sendLog: function()
{
Ext.Ajax.request({
url: url,
cors: false,
useDefaultXhrHeader : false,
method: 'POST',
params:
{
"message": "test"
},
success: function () {
alert('success');
},
failure: function () {
alert('failure');
}
});
}