Fluentd から BigQuery へのデータの流し込みを行っており、以下のような JSON を body に持った HTTP リクエストを Fluentd 側で受ける場合に、BigQuery に message という key を削除して、流し込むにはどうすればよいかご存知の方がいらっしゃったら教えていただきたいです。
curl -X POST -d "{\"message\":[{\"answer\":\"YES\",\"count\":8,\"maincomplaint_id\":33,\"start_time\":\"2016-12-10 03:09:26\",\"sid\":\"s1436\",\"event_time\":\"2016-12-10 03:09:43\",\"user_id\":21,\"gender\":\"m\",\"age\":17}, {\"answer\":\"NO\",\"count\":8,\"sid\":\"s1436\",\"event_time\":\"2016-12-10 03:09:43\",\"user_id\":21,\"gender\":\"m\",\"age\":18,\"client\":\"android\"} ]}" http://localhost:8888/user_activity/answer
td-agent.conf
td
1<source> 2 @type http 3 port "#{ENV['PORT']}" 4 keepalive_timeout 10s 5 format none 6</source> 7 8<match user_activity.*> 9 @type forest 10 subtype parser 11 <template> 12 @type parser 13 key_name message 14 tag user_activity.bigquery.${tag_parts[2]} 15 format json 16 </template> 17</match> 18 19<match user_activity.bigquery.*> 20 @type forest 21 subtype bigquery 22 <template> 23 method insert 24 25 auth_method json_key 26 email XXXX@YYYYYY.iam.gserviceaccount.com 27 json_key ./ZZZZZZZZZZZZ.json 28 29 project auto-diagnosis 30 dataset ${tag_parts[0]} 31 auto_create_table true 32 table ${tag_parts[2]}%{time_slice} 33 34 time_field event_time 35 schema_path ./${tag_parts[2]}_schema.json 36 37 buffer_path ./buffer/td 38 buffer_chunk_limit 1m 39 buffer_queue_limit 512 40 </template> 41</match> 42
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。