Zabbix preprocessing: Difference between revisions
From DWIKI
Tag: wikieditor |
Tag: wikieditor |
||
| Line 9: | Line 9: | ||
=LLD= | =LLD= | ||
==LLD with javascript and CSV to JSON== | ==LLD with javascript and CSV to JSON== | ||
* https://www.zabbix.com/documentation/current/en/manual/config/items/preprocessing/csv_to_json | |||
===Regular expression=== | ===Regular expression=== | ||
^ *(node0 .*) \1 | ^ *(node0 .*) \1 | ||
| Line 23: | Line 25: | ||
===CSV to JSON=== | ===CSV to JSON=== | ||
With header | With header | ||
=Javascript= | =Javascript= | ||
Latest revision as of 08:04, 13 April 2026
Get data from a file
Item
vfs.file.contents[/some/file]
regular expression
([0-9]+)\s+([0-9]+)\s+([0-9x]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\n [\4, \5, \6, \7]
LLD
LLD with javascript and CSV to JSON
Regular expression
^ *(node0 .*) \1
Javascript
var s=value.trim().split(/\s+/);
var len = s.length;
var ret = "{#NODE}";
for ( i = 0;i < len;i++) {
ret = ret + "\n";
ret = ret + i;
}
return ret;
CSV to JSON
With header
