LoginSignup
0
1

More than 5 years have passed since last update.

Splunkでkafkaからデータを取得する

Last updated at Posted at 2017-07-13

Overview

kafkaにpushされたデータをsplunk側でpullできるようにする。

構成

EC2 : m3.large
Kafka : 2.11-0.10.2.0
Splunk : Enterprise 6.6.2
※とりあえず動きだけみたかったので、すべて1台のサーバ上で構築。

install

インストールについては、kafka公式ドキュメントを参考。
https://kafka.apache.org/quickstart

splunk側はこの記事参照。
http://qiita.com/saeoshi/items/d1db4ca5c9af79e04fed

zk起動

./bin/zookeeper-server-start.sh config/zookeeper.properties &

kafka起動

./bin/kafka-server-start.sh config/server.properties

topic作成

bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test

test message送信

./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
aaaa

splunk側設定

kafka consumer用のmoduler inputをdownloadしてくる。

Appをinstallする。

web interfaceからmanage app → install app from fileで、先にダウンロードしたファイルをupする。

Screen Shot 2017-07-13 at 4.40.41 PM.jpg

取り込みの設定

Setting → Data inputsから、Local inputのkafka Messagingを選択する。
設定は下記の通り。

Screen Shot 2017-07-13 at 4.43.43 PM.jpg

Screen Shot 2017-07-13 at 4.44.37 PM.jpg

テストしてみる

下記のdmesgをとりあえず、送ってみる。


[ 5.113147] audit: type=1400 audit(1499923805.268:6): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/bin/lxc-start" pid=646 comm="apparmor_parser"
[ 5.113770] audit: type=1400 audit(1499923805.268:7): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/sbin/dhclient" pid=645 comm="apparmor_parser"
[ 5.113777] audit: type=1400 audit(1499923805.268:8): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=645 comm="apparmor_parser"
[ 5.113783] audit: type=1400 audit(1499923805.268:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=645 comm="apparmor_parser"
[ 5.113789] audit: type=1400 audit(1499923805.268:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/connman/scripts/dhclient-script" pid=645 comm="apparmor_parser"

splunk側の検索

こういう形でsplunk側から検索できる。

Screen Shot 2017-07-13 at 4.46.04 PM.jpg

Memo

hostの設定については、別途configで設定が必要なので、あとでやってみる

0
1
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
1