インストール

無料版でも有料版でもバイナリはいっしょ。 rpmが用意されているので実行する。splunkユーザーが追加されるので。splunkユーザになる。

設定ファイルの場所

/opt/splunk/etc/system/default設定ファイルデフォルトディレクトリ。バージョンアップで上書きされる可能性があるので変更するならローカル上書きフォルダ
/opt/splunk/etc/system/localローカルで上書きする場合のファイル

起動

su - splunk
splunk start 
splunk stop

splunkユーザーだと8000ポートで起動するので、nginxでproxy設定をして80アクセス可能とした。

       location / {
               proxy_pass   http://127.0.0.1:8000/;
       }

設定ファイルによるカスタムフィールドの定義

transforms.conf正規表現を定義する
props.confソースタイプごとの設定を行う。文字コードや上記正規表現の適用など
fields.confフィールドごとにINDEXEDの有無を設定
ui-prefs.confデフォルトのUIを指定する。デフォルトが全期間となっており危険なので変更した

デフォルトの検索時間設定

[search]
dispatch.earliest_time = -24h
dispatch.latest_time = now
            
[default]
dispatch.earliest_time = -24h
dispatch.latest_time = now

インデックス

splunkのインデックスはその単位で物理ファイルに分かれている。 インデックスの状態はhot,warm,coldなどなど。設定は indexes.confで行う。

オペレーション

ソースごとの使用量

index=_internal source=*license_usage.log type=Usage earliest=-20d
| eval MB = b/1024/1024
| rename s AS source
| timechart span=1d sum(b) AS "Total MB used" by source
index=_internal sourcetype="splunkd" group="per_sourcetype_thruput" series!=splunk* | eval mb=kb/1024 | timechart limit=20 minspan=1d sum(mb) by series
index=_internal sourcetype="splunkd" group="per_sourcetype_thruput" series!=splunk* | eval mb=kb/1024 | timechart limit=20 minspan=1h sum(mb) by series

Emailの送信履歴

index=_internal ( sourcetype=scheduler alert_actions="email" ) OR ( sourcetype=splunk_python "sendemail" )

出力フィールドを絞る

サーチ文字列 | fields column1,column2

出力フィールドをテーブル形式にする。

サーチ文字列 | table column1,column2

消す(権限が必要)

サーチ文字列 | delete

アラート送信時のカスタムスクリプト

http://docs.splunk.com/Documentation/Splunk/latest/Alert/Configuringscriptedalerts

トラブルシューティング

サーチしたら「waiting for queued job to start...」とでる同時実行数をこえてサーチが実行された。ひたすら待つかパラメータの調整を

構成要素

Splunk Forwarder

データ転送エージェントいくつか種類があるが、単なる転送だけであれば、universal forwarderでよい。heavy forwarderはsplunk本体から転送機能に特化したアーカイブであり、フィルタリングなどの高度なことを実施したい場合に選択する。light forwarderは単純なことしかできないのでuniversal forwarderにとってかわられた。

Splunk indexer

生データをindexに投入する役割。


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2022-10-14 (金) 13:16:53