Can I monitor a JSON file? Example included.
Hi,
We have a script that runs and creates an output like the file attached. We need to be able to parse this file and look at the “replication” and “counts_match” fields and alert if we don’t find certain criteria. Can LM do that?
I think that LM can only access files directly if they are on a collector, so we’d make sure this file ends up there.
Thanks.
I guess I can’t attach a file so here’s what it looks like:
{
"replication": [
{
"db_name": "db1 ",
"replication": "running ",
"local_count": "12054251",
"remote_count": "8951389",
"counts_match": "false"
},
{
"db_name": "db2 ",
"replication": "running ",
"local_count": "0",
"remote_count": "0",
"counts_match": "true"
},
{
"db_name": "db3 ",
"replication": "running ",
"local_count": "0",
"remote_count": "0",
"counts_match": "true"
},
{
"db_name": "db4 ",
"replication": "running ",
"local_count": "97",
"remote_count": "97",
"counts_match": "true"
},
{
"db_name": "db5 ",
"replication": "running ",
"local_count": "0",
"remote_count": "0",
"counts_match": "true"
}
]
}