Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ CREATE TABLE fluentd (
#tag_col tag
#record_col record
#msgpack false
#encoder yajl
#encoder json
</match>
```

Expand All @@ -87,7 +87,7 @@ CREATE TABLE fluentd (
|tag_col|The column name for the tag|`tag`|
|record_col|The column name for the record|`record`|
|msgpack|If true, insert records formatted as msgpack|`false`|
|encoder|JSON encoder (`yajl`, `json`)|`yajl`|
|encoder|JSON encoder (`yajl`, `json`) Starting from v1.0.3, `yajl` is no longer available and internally defaults to `json`|`json`|

## Copyright

Expand Down
6 changes: 3 additions & 3 deletions lib/fluent/plugin/out_pgjson.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require "fluent/plugin/output"
require "pg"
require "yajl"
require "json"

module Fluent::Plugin
Expand Down Expand Up @@ -34,7 +33,7 @@ class PgJsonOutput < Fluent::Plugin::Output
desc "If true, insert records formatted as msgpack"
config_param :msgpack, :bool, default: false
desc "JSON encoder (yajl/json)"
config_param :encoder, :enum, list: [:yajl, :json], default: :yajl
config_param :encoder, :enum, list: [:yajl, :json], default: :json # NOTE: Contains yajl for backward compatibility

config_param :time_format, :string, default: "%F %T.%N %z"

Expand All @@ -56,7 +55,8 @@ def configure(conf)
end
@encoder = case @encoder
when :yajl
Yajl
log.info "encoder 'yajl' is deprecated. Please use 'json' instead."
JSON
when :json
JSON
end
Expand Down
2 changes: 1 addition & 1 deletion test/plugin/test_out.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class PgJsonOutputTest < Test::Unit::TestCase
TIME_COL = "time"
TAG_COL = "tag"
RECORD_COL = "record"
ENCODER = Yajl
ENCODER = JSON

CONFIG = %[
@type pgjson
Expand Down