LoginSignup
0
1

More than 3 years have passed since last update.

indexに格納されている文字を確認する walklex

Last updated at Posted at 2019-12-07

小ネタ

なお、

This documentation applies to the following versions of Splunk® Enterprise: 7.3.0, 7.3.1, 7.3.2, 7.3.3, 8.0.0

2020年問題もあるし、大丈夫ですよね。

walklex

walklex
こんなコマンドがあったのね。

UseCASE and TERM to match phrasesに書かれている通り、検索するにもTERM()を使うとちょっと速くなる。

でもサーチはどのように動くか How Search Works - ブルームフィルタ、TSIDX、TERMによる匠の世界へP30がうまく動くためには、メジャーブレイカーとか知らないといけない。

だったら、そもそも登録されている内容を確認すればいいじゃない

SPL
| walklex index=botsv1

説明
イベントインデックスの各バケットから用語またはインデックス付きフィールドのリストを生成します。 マージされたレキシコンファイルまたは単一のtsidxファイルを持つウォームバケットにのみ適用されます。

termに登録されている一覧がでるので、その単語で検索TERM(" ")すれば、高速!のはず。

確認してみる。

SPL
index=botsv1 cs_uri_stem="/RootDevice.xml"

index=botsv1 TERM(cs_uri_stem::/RootDevice.xml)

結果は
This search has completed and has returned 1 件の結果 by scanning 16 件のイベント in 1.268 seconds

This search has completed and has returned 1 件の結果 by scanning 1 件のイベント in 1.48 seconds

なんだろう...またこんな結果に。でも、そもそもの検索時間が速い。

まとめ

Splunkのバージョンが上がって新しいコマンドが増えている。
今回のコマンドは、ダッシュボードとか定期的に使用するSPLをチューニングする際に使えると思います。

:sweat: 昔つくったクエリー直さないとな

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