Splunk Search

removeコマンド実行時の挙動について

msgtrk
Path Finder

GUI上でインデックスをデフォルトで作成し、インデックス内のデータ有無に関わらず
以下のパターンで削除を実行した場合に挙動に違いがありました。


【インデックスの作成】
「Search」app以外のappの管理画面(例:http://hostname:8000/ja-JP/manager/launcher/data/indexes)から
インデックスを作成。(インデックス名以外設定値はデフォルト)

【インデックス削除パターン1】
・GUIから[削除]アクションを実行してしてインデックスを削除
・Splunkを起動させたままCLIでsplunk remove index を実行してインデックスを削除

【インデックス削除パターン2】
・Splunkを停止させた後、CLIでsplunk remove index を実行してインデックスを削除




パターン1のどちらかでインデックスを削除した場合は、GUI画面上・対象app配下にあるindexes.confから
対象インデックスが削除されたことを確認しましたが、パターン2を実行した場合、
データベースは削除されますがindexes.confから対象インデックスの情報が削除されず、
GUI画面上にも表示されたままとなってしまいます。

その状態でGUIから[削除]アクションを実行すると
「Error occurred attempting to remove : In handler 'indexes': index= Disabled.」
が表示されインデックスがGUI上から削除できなくなります。
(indexes.confで直接設定情報を削除してsplunkを再起動すれば削除されます。)

なお、インデックス作成時に「Search」appの管理画面の場合には、
上記の削除パターンすべてで正常に削除されることを確認できました。

こちらのパターン2の挙動は仕様となるのでしょうか。

0 Karma
1 Solution

melonman
Motivator

少し自分の環境で確認してみたのですが、

Splunkを停止した後に、remove index を実行すると、

[test]
coldPath = $SPLUNK_DB/test/colddb
homePath = $SPLUNK_DB/test/db
thawedPath = $SPLUNK_DB/test/thaweddb
deleted = true
disabled = true

という形で、deletedとdisabledというパラメータが追加されるようです。
これらの意味は、

$SPLUNK_HOME/etc/system/README/indexes.conf.spec

ファイル内に記載されてました。

disabled = true|false
* Toggles your index entry off and on.
* Set to true to disable an index.
* Defaults to false.

deleted = true
* If present, means that this index has been marked for deletion: if splunkd is running,
deletion is in progress; if splunkd is stopped, deletion will re-commence on startup.
* Normally absent, hence no default.
* Do NOT manually set, clear, or modify value of this parameter.
* Seriously: LEAVE THIS PARAMETER ALONE.

このフラグが付いていると、GUIからエントリーがあった場合でも、ご確認されたエラーが帰ってくるようです。

…エンハンスメントしてほしい箇所ではありますね…

View solution in original post

0 Karma

melonman
Motivator

少し自分の環境で確認してみたのですが、

Splunkを停止した後に、remove index を実行すると、

[test]
coldPath = $SPLUNK_DB/test/colddb
homePath = $SPLUNK_DB/test/db
thawedPath = $SPLUNK_DB/test/thaweddb
deleted = true
disabled = true

という形で、deletedとdisabledというパラメータが追加されるようです。
これらの意味は、

$SPLUNK_HOME/etc/system/README/indexes.conf.spec

ファイル内に記載されてました。

disabled = true|false
* Toggles your index entry off and on.
* Set to true to disable an index.
* Defaults to false.

deleted = true
* If present, means that this index has been marked for deletion: if splunkd is running,
deletion is in progress; if splunkd is stopped, deletion will re-commence on startup.
* Normally absent, hence no default.
* Do NOT manually set, clear, or modify value of this parameter.
* Seriously: LEAVE THIS PARAMETER ALONE.

このフラグが付いていると、GUIからエントリーがあった場合でも、ご確認されたエラーが帰ってくるようです。

…エンハンスメントしてほしい箇所ではありますね…

0 Karma

melonman
Motivator

ちなみに、5.0.3で確認しました。

0 Karma

cwl
Contributor

答えになってなくて大変すみませんが、不具合の可能性があります。

サポートケースを登録すれば、Splunkサポートが詳細に確認してくれるはずです。

0 Karma

msgtrk
Path Finder

環境はWindows Server 2008、splunk5.0.2 です。

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...