Created
July 15, 2015 12:29
-
-
Save neilhwatson/4b01b0c86c84cba6eef7 to your computer and use it in GitHub Desktop.
data processing for rlinder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
neil@ettin ~/.cfagent/inputs $ cat rlinder.cf | |
body common control | |
{ | |
bundlesequence => { | |
"main", | |
}; | |
} | |
bundle agent main | |
{ | |
methods: | |
"any" usebundle => test; | |
} | |
bundle agent test | |
{ | |
vars: | |
"pwds" data => parsejson(' | |
[ | |
{ "user": "joe", | |
"hash": "*KRB*", | |
"uid" : "1357", | |
"promisee": "sysadmin team", | |
}, | |
{ "user": "bob", | |
"hash": "*LCK*", | |
"uid" : "1354", | |
"promisee": "sysadmin team", | |
} | |
] | |
'); | |
"i" slist => getindices( "pwds" ); | |
"users[${i}]" string => "${pwds[${i}][user]}"; | |
"users" slist => getvalues( 'users' ); | |
reports: | |
"method( ${pwds[${i}][user]},${pwds[${i}][hash]},${pwds[${i}][uid]},${pwds[${i}][promisee]} )"; | |
"users: ${users}"; | |
} | |
neil@ettin ~/.cfagent/inputs $ cf-agent -Kf ./rlinder.cf | |
R: method( joe,*KRB*,1357,sysadmin team ) | |
R: method( bob,*LCK*,1354,sysadmin team ) | |
R: users: bob | |
R: users: joe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment