Sha256: d6e2b7a6f5b6e8f3f1cfb9776026aeca44d8b4890c88be260065acbd07ddf60e

Contents?: true

Size: 628 Bytes

Versions: 14

Compression:

Stored size: 628 Bytes

Contents

require 'json'
require 'msgpack'

def gen_tsv(time)
  "#{time}\ttag1\tok"
end

def gen_json(time)
  {'tag' => 'tag1', 'time' => time, 'k1' => 'ok'}.to_json
end

def gen_msgpack(time)
  {'tagger' => 'tag1', 'datetime' => time, 'k1' => 'ok'}.to_msgpack
end

def gen_raw_string(time)
  "#{time} hello"
end

def gen_invalid_json(time)
  %({"tag": "tag1", "time": #{time}, "k1": "ok", })
end

time = ARGV.first
time = Integer(time) rescue time

case ARGV.last.to_i
when 0
  puts gen_tsv(time)
when 1
  puts gen_json(time)
when 2
  print gen_msgpack(time)
when 3
  print gen_raw_string(time)
when 4
  print gen_invalid_json(time)
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
fluentd-0.12.43 test/scripts/exec_script.rb
fluentd-0.12.42 test/scripts/exec_script.rb
fluentd-0.12.41 test/scripts/exec_script.rb
fluentd-0.12.40 test/scripts/exec_script.rb
fluentd-0.12.39 test/scripts/exec_script.rb
fluentd-0.12.38 test/scripts/exec_script.rb
fluentd-0.12.37 test/scripts/exec_script.rb
fluentd-0.12.36 test/scripts/exec_script.rb
fluent-plugin-detect-memb-exceptions-0.0.2 vendor/bundle/ruby/2.0.0/gems/fluentd-0.12.35/test/scripts/exec_script.rb
fluent-plugin-detect-memb-exceptions-0.0.1 vendor/bundle/ruby/2.0.0/gems/fluentd-0.12.35/test/scripts/exec_script.rb
fluentd-0.12.35 test/scripts/exec_script.rb
fluentd-0.12.34 test/scripts/exec_script.rb
fluentd-0.12.33 test/scripts/exec_script.rb
fluentd-0.12.32 test/scripts/exec_script.rb