Created
July 24, 2013 12:28
-
-
Save holysugar/6070096 to your computer and use it in GitHub Desktop.
out_exec_filter で jq (内容は適当)
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
| <source> | |
| type forward | |
| </source> | |
| <match json.**> | |
| type exec_filter | |
| tag debug.json | |
| command jq '{a, b, c, x: .other.x, nextfoo: .other.next.foo, time}' | |
| in_format json | |
| out_format json | |
| time_key time | |
| flush_interval 1s | |
| </match> | |
| <match **> | |
| type stdout | |
| </match> | |
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
| require 'fluent-logger' | |
| @logger = Fluent::Logger::FluentLogger.new('json') | |
| def log | |
| @logger.post("foo", { | |
| a: rand(100), b: rand(100), c: rand(100), | |
| time: Time.now.to_i, | |
| other: { | |
| x: rand(10), y: rand(10), z: rand(10), | |
| next: { foo: rand(10) } | |
| } | |
| }) | |
| end | |
| 20.times do; puts Time.now; 10.times{ log }; sleep 0.5; end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment