Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BEGIN {
- FS = ":";
- OUTDIR="/work/zabbix/"
- }
- /^ITEM-ID/ {itemid = gensub(/\s/,"","g",$2);rmfile=OUTDIR itemid;system("test -e " rmfile " && rm " rmfile)}
- /"value"/ {val = gensub(/\s\"(.+)\"\,/,"\\1","g",$2)}
- /"clock"/ {clk = gensub(/\s\"(.+)\"/,"\\1","g",$2)
- clk = strftime("%Y/%m/%d %H:%M:%S",clk)
- printf "%s\n", clk "," val >> OUTDIR itemid
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement