Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fs = require('fs');
- const json = JSON.parse(fs.readFileSync('blast.txt'));
- let count = 0;
- let cvar = 'sm_cidr_version';
- let cvar_count = {};
- Object.keys(json).forEach((key) => {
- if (json[key].hasOwnProperty('rules')) {
- if (json[key].rules.hasOwnProperty(cvar)) {
- let value = json[key].rules[cvar];
- if (cvar_count.hasOwnProperty(value))
- cvar_count[value]++;
- else
- cvar_count[value] = 1;
- }
- }
- });
- console.log(cvar_count);
Advertisement
Add Comment
Please, Sign In to add comment