LoginSignup
0
0

More than 5 years have passed since last update.

ローカル fluentd導入手順メモ

Last updated at Posted at 2019-03-05

fluentdインストール

Fluentdのサイトのstep1,step2を実行(step3で動作確認)

タグを追加する場合

sudo vim /etc/td-agent/td-agent.conf

<match {tagname}>
  @type stdout
</match>

fluentd起動

sudo /etc/init.d/td-agent start

goで使用

go get "github.com/t-k/fluent-logger-golang/fluent"

f, _ := fluent.New(fluent.Config{})
f.Post("debug.test", map[string]string{"message": "hello"})
f.PostWithTime("reply", time.Now(), map[string]interface{}{"data": "hello"})

output /var/log/td-agent/td-agent.log

2017-06-29 05:56:20 +0200 debug.test: {"message":"hello"}
2017-06-29 05:56:20 +0200 reply: {"data":"hello"}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0