Splunk Search

サブサーチで何もヒットしない時、メインサーチのソースで全検索されてしまいます。 If subsearch is no result, Mainsearch execute Full Search

sybb6616
New Member

source="logA" [search source="logB" "valueA" | return fieldA]

上記のように検索する時、もしサブサーチ内でvalueAの検索結果が無い時、サブサーチで何も値が返されないため、メインサーチでlogAのログを全て検索されてしまいます。 これを阻止する方法を教えてください。

If subsearch is no result, Mainsearch execute Full Search...
i wanna if subsearch is no results, don't search for logA of Mainsearch.
Please teach me...

0 Karma
1 Solution

HiroshiSatoh
Champion

本当はfillnullで値の編集が必要かと思いましたが以下でいきそうです。

source="logA" [search source="logB" "valueA" | return fieldA]

↓マニュアルではいっしょの結果になりそうですが、下は結果が返りません。

source="logA" [search source="logB" "valueA" | head 1| fields fieldA]

View solution in original post

0 Karma

sybb6616
New Member

valueA自体に

0 Karma

sybb6616
New Member

本当はvalueA自体のサブサーチを使っており、returnはtableで行を返してるため、うまく言った感じではなかったのですが、joinのタイプをtype=leftにしたら解決しました。

ありがとうございます。

0 Karma

HiroshiSatoh
Champion

本当はfillnullで値の編集が必要かと思いましたが以下でいきそうです。

source="logA" [search source="logB" "valueA" | return fieldA]

↓マニュアルではいっしょの結果になりそうですが、下は結果が返りません。

source="logA" [search source="logB" "valueA" | head 1| fields fieldA]

0 Karma
Get Updates on the Splunk Community!

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...

Splunk App Developers | .conf25 Recap & What’s Next

If you stopped by the Builder Bar at .conf25 this year, thank you! The retro tech beer garden vibes were ...

Congratulations to the 2025-2026 SplunkTrust!

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