2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Splunk searchとwhereの違い

Posted at

https://twitter.com/GreggWoodcock/status/1269327397301751811
ということで、 @woodcockがプレゼンをやるということなので、こちらも勝手にやってみる。

違い

コマンド 大文字小文字 結局なんなのよ
search 関係なし サーチなので
where 関係あり evalと一緒

解説

evalがケースセンシティブというのはfundamental1で教えてくれる大事なこと。
逆にsearchはケースインセンシティブ
日本語でここら辺を簡潔にいうのはなんていうのだろう:question:

statsの後とかwheresearchかは

  1. どちらにしてもフィールド名=は必要
  2. 正規表現とか考えるとwhereのほうがやれることが多い
  3. 単純にフィールドの値を限定するならsearchの方がわかりやすい
  4. "で囲うのを忘れるのはwhereでは致命的

whereの評価はevalというのは、結構忘れやすいかもしれない。
そのため、4番目の制限でエラーになりやすい(かも)

まとめ

大文字小文字を「気にする」か「気にしないか」と文字列を"で「囲わない」と「囲う」の違いが大きいsearchwhere

自分の案件はwhereでSplunk>Answersで答える時はsearchでやるのが多いです。

Splunk>Answersの質問者は詳細が分からないとこが多いですし。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?