-
Incident report
-
Resolution: Unresolved
-
Trivial
-
None
-
5.0.5
-
None
-
Debian 10
I'm trying to monitor logs in Zabbix.
We have a master item which receives data in the JSON format:
{"time":"2020-11-26T14:56:02+00:00","method":"POST","status": "200","code":"uk","request_time":"0.140"} {"time":"2020-11-26T14:56:02+00:00","method":"POST","status": "200","code":"au","request_time":"0.060"} ...
Also we have a discovery rule which detects different codes and creates dependent items:
- Request time (uk)
- Request time (au)
- ...
To extract data we use the following preprocessing rule:
So the the above example for the for the first log line we have:
- Request time (uk) = 0.140
- Request time (au) - discarded
But instead of discarding items if not found, zabbix proxy stores empty values in its database.
Here is example:
slow query: 50.739578 sec, "insert into proxy_history (itemid,clock,ns,value,flags,write_clock) values (47220,1606400543,3637904,'',2,1606400554),(47238,1606400543,3637904,'',2,1606400554),(47217,1606400543,3637904,'',2,1606400554),(47226,1606400543,3637904,'',2,1606400554),(47230,1606400543,3637904,'',2,1606400554),(47219,1606400543,3637904,'',2,1606400554),(47234,1606400543,3637904,'',2,1606400554),(47221,1606400543,3637904,'',2,1606400554),(47216,1606400543,3637904,'',2,1606400554),(47225,1606400543,3637904,'',2,1606400554),(47224,1606400543,3637904,'',2,1606400554),(47223,1606400543,3637904,'',2,1606400554),(47218,1606400543,3637904,'',2,1606400554),(47227,1606400543,3637904,'',2,1606400554),(47228,1606400543,3637904,'',2,1606400554),(47229,1606400543,3637904,'0.19900000000000001',0,1606400554),(47222,1606400543,3637904,'',2,1606400554),(47231,1606400543,3637904,'',2,1606400554),(47232,1606400543,3637904,'',2,1606400554),(47233,1606400543,3637904,'',2,1606400554),(47215,1606400543,3637904,'',2,1606400554),(47235,1606400543,3637904,'',2,1606400554),(47236,1606400543,3637904,'',2,1606400554),(47237,1606400543,3637904,'',2,1606400554),(47214,1606400543,3637904,'',2,1606400554);
Instead of this I expected something like this:
"insert into proxy_history (itemid,clock,ns,value,flags,write_clock) values (47229,1606400543,3637904,'0.19900000000000001',0,1606400554);
So if I have 100 dependent items, then 99% of the data in the database is just garbage.
Why is the data not discarded, but stored as blank values?