LoginSignup
6
6

More than 5 years have passed since last update.

FluentdからSplunkにバランシングしながらデータ投入する方法

Posted at

すでにFluentdでログ転送しつつ、ラムダアーキテクチャ的にSplunkでリアルタイム分析したいなーとおもったのですが、Splunk自体にはロードバランシングする機能がなく、負荷が高い場合には自分でバランシングする方法を採らないとならなかったのでプルリク送ってマージしてもらったのでメモ。

fluent-plugin-splunkapi

Splunkへのインサートはfluent-plugin-splunkapiを使います。
以下はGithubのリポジトリから引用して変更。

<match **>
  type splunkapi
  protocol rest
  server <host1>:<port1>,<host2>:<port2>[,<host3>:<port3>]
  verify false
  auth admin:changeme

  # Convert fluent tags to Splunk sources.
  # If you set an index, "check_index false" is required.
  host YOUR-HOSTNAME
  index SOME-INDEX
  check_index false
  source {TAG}
  sourcetype fluent

  # TIMESTAMP: key1="value1" key2="value2" ...
  time_format unixtime
  format kvp

  # Memory buffer with a short flush internal.
  buffer_type memory
  buffer_queue_limit 16
  buffer_chunk_limit 8m
  flush_interval 2s
</match>

要はserver設定をカンマ区切りで記載すればラウンドロビンでバランシングします。
最後にマージしていただいたk24dさんありがとうございました!

6
6
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
6
6