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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

Ready to make your IT operations smarter and more efficient? Discover how to automate Splunk alerts with Red ...