13
Fluentd with Drupal Rest API Yoshikazu Aoyama

Fluentd with drual 8

Embed Size (px)

Citation preview

Page 1: Fluentd with drual 8

Fluentd with Drupal Rest API

Yoshikazu Aoyama

Page 2: Fluentd with drual 8

自己紹介 青山 義万 ( あおやま よしかず ) twitter: @blauerberg drupal.org: blauerberg Drupal 歴 : 6 年くらい (4.x ~ )

Page 3: Fluentd with drual 8

LTのテーマ : Fluentd と D8 の組み合わせで何かやる Drupal 8 から core だけで Rest API が作れるようになったので、 Fluentd から

Drupal 8 に Rest API 経由でデータを登録してみます。

Rest API

Raw Input

Page 4: Fluentd with drual 8

やらないといけない事 fluentd の入力を Drupal の Rest API が理解できる形に変換して出力する

Rest API

Raw Input

Page 5: Fluentd with drual 8

http://www.fluentd.org/plugins とかにすでにあるんじゃないの? 誰もそんなマイナーな plugin は作ってないようです ..

Page 6: Fluentd with drual 8

fluent-plugin-drupal-rest

5 時間前から絶賛開発中!

Page 7: Fluentd with drual 8

fluent-plugin-drupal-rest

Outputinput

in_http

in_tail

in_exec

in_****

out_drupal

Page 8: Fluentd with drual 8

Fluentd の初期設定 sudo apt-get install –y ruby ruby-dev sudo gem install fluentd cd ~ fluentd –setup fluent cd fluent edit fluentd.conf sudo fluentd -c ~/fluent/fluent.conf -p ~/fluent/plugin -vv

Page 9: Fluentd with drual 8

fluentd.conf<match drupal.**> @type drupal_rest @id drupal_test host http://192.168.x.x port 80 content_type article auth basic basic_auth_user admin basic_auth_pass notasecret</match>

Page 10: Fluentd with drual 8

Drupal 8 で Rest API を使うための初期設定

Page 11: Fluentd with drual 8

Drupal 8 で Rest API を使うための初期設定 cd {your_drupal_root}/sites/default curl -O

https://gist.githubusercontent.com/blauerberg/53486ecea3fd20e0ee77/raw/e66580576c03639f5f69602c7a1ac393b539c081/rest.settings.yml

https://www.drupal.org/node/2098511

Page 12: Fluentd with drual 8

demo in_http と fluent-cat in_tail からデータを流し込む

Page 13: Fluentd with drual 8

まとめ Drupal 8 は Rest API が開発なしですぐに使えます fluent-plugin-drupal-rest 近日公開? Drupal ONSEN でお披露目するとかしないとか