Last active
August 29, 2015 14:16
-
-
Save neilhwatson/179a0112ab1f687cd47e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| body common control | |
| { | |
| bundlesequence => { "log", "test" }; | |
| } | |
| bundle agent log | |
| { | |
| vars: | |
| "x" data => parsejson(' | |
| [ | |
| { | |
| "foo" : "this line", | |
| "bar" : "another line" | |
| }, | |
| { | |
| "foo" : "next line", | |
| "bar" : "another next line" | |
| } | |
| ] | |
| '); | |
| "i" slist => getindices( "x" ); | |
| reports: | |
| "<foo>${x[${i}][foo]}</foo> <bar>${x[${i}][bar]}</bar>" | |
| report_to_file => "/tmp/jeffa.log"; | |
| "<foo>${x[${i}][foo]}</foo> <bar>${x[${i}][bar]}</bar>" | |
| report_to_file => "/tmp/jeffa_two.log"; | |
| } | |
| bundle agent test | |
| { | |
| commands: | |
| "/usr/bin/tail /tmp/jeffa.log"; | |
| "/usr/bin/tail /tmp/jeffa_two.log"; | |
| } | |
| neil@ettin ~/.cfagent/inputs $ cf-agent -Kf ./jeffa.cf | |
| 2015-02-26T14:26:51-0500 notice: /default/test/commands/'/usr/bin/tail /tmp/jeffa.log'[0]: Q: "...r/bin/tail /tmp": <foo>this line</foo> <bar>another line</bar> | |
| Q: "...r/bin/tail /tmp": <foo>next line</foo> <bar>another next line</bar> | |
| Q: "...r/bin/tail /tmp": <foo>this line</foo> <bar>another line</bar> | |
| Q: "...r/bin/tail /tmp": <foo>next line</foo> <bar>another next line</bar> | |
| Q: "...r/bin/tail /tmp": <foo>this line</foo> <bar>another line</bar> | |
| Q: "...r/bin/tail /tmp": <foo>next line</foo> <bar>another next line</bar> | |
| Q: "...r/bin/tail /tmp": <foo>this line</foo> <bar>another line</bar> | |
| Q: "...r/bin/tail /tmp": <foo>next line</foo> <bar>another next line</bar> | |
| Q: "...r/bin/tail /tmp": <foo>this line</foo> <bar>another line</bar> | |
| Q: "...r/bin/tail /tmp": <foo>next line</foo> <bar>another next line</bar> | |
| 2015-02-26T14:26:51-0500 notice: /default/test/commands/'/usr/bin/tail /tmp/jeffa_two.log'[0]: Q: "...r/bin/tail /tmp": <foo>this line</foo> <bar>another line</bar> | |
| Q: "...r/bin/tail /tmp": <foo>next line</foo> <bar>another next line</bar> | |
| Q: "...r/bin/tail /tmp": <foo>this line</foo> <bar>another line</bar> | |
| Q: "...r/bin/tail /tmp": <foo>next line</foo> <bar>another next line</bar> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice solution neil. Thanks for all the community support!