I have a webpage that takes a JSON via var url = myReport.json
and displays information. The information it displays are server information that I am monitoring.
The server information monitors all applications running on the server, but it filters back ones that are named company_name_
and looks like this:
company_name_app1
company_name_app2
company_name_app3
company_name_app4
company_name_app5
On the html page, I want to remove the strings company_name_
so that the webpage will just display the following:
app1
app2
app3
app4
app5
Is there a way to remove a specified string match from the JSON entries so I can display it as wanted above?
EDIT:
<script>
//define a function that will fetch status and set icon URL
function setServerProcessesServer1761() {
var url = "Server1761.json";
var $svc = $("#Server1761-processes"); //get a reference to your <div>
$.getJSON(url, function(data) {
document.getElementById("Server1761-processes").innerHTML = data.processes.filter(s => s.Name.value.includes("company_name")).map(s => `<tr><td>${s.Name.value}</td> <td>${s.Status}</td></tr>`).join('\n');
$('#Server1761-processes').html(function (_, html) { return html.replace(/runn1ng/g,"<img src='smallgreen.png' />")});
$('#Server1761-processes').html(function (_, html) { return html.replace(/fai1ed/g,"<img src='smallred.png' />")});
}); // you will have to concatenate the entire services request line on line 130
}
//special jQuery syntax to run when document is ready (like onload but better)
$(function() {
setServerProcessesServer1761();
});
</script>