<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Join query with condition and comparison in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-query-with-condition-and-comparison/m-p/627765#M218118</link>
    <description>&lt;P&gt;Not sure if it would be more efficient, but maybe eventstats could be helpful here?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;index=abc
| eventstats values(message) as all_messages by requestId
| where sourcetype="payment" AND log_level="Error" AND NOT match(all_messages,"insufficient balance")
| ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jan 2023 14:43:13 GMT</pubDate>
    <dc:creator>maciep</dc:creator>
    <dc:date>2023-01-20T14:43:13Z</dc:date>
    <item>
      <title>How to join query with condition and comparison?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-query-with-condition-and-comparison/m-p/627753#M218114</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I need to show error messages for one particular service. But the challenge here is that for example ,&lt;/P&gt;
&lt;P&gt;I need to show error messages including "withdrawal failed" error. But if this error happened because of "insufficient&amp;nbsp; balance" then this withdrawal failed should not be listed. Other error messages should be listed anyway.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;e.g query:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;index=abc sourcetype=payment log_level=Error |table&amp;nbsp; message.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Result would be like:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;withdrawal failed&lt;BR /&gt;deposit failed&lt;BR /&gt;Error 404&lt;BR /&gt;customer not found&lt;/P&gt;
&lt;P&gt;But i want something like,&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;index=abc sourcetype=payment log_level=Error&lt;/EM&gt;&lt;BR /&gt;and&lt;BR /&gt;&lt;STRONG&gt;| search message="*Withdrawal failed*"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;| join type=inner requestId [search index=abc &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;| search message ="*insufficient balance*"]&lt;/STRONG&gt;&amp;nbsp; --&amp;gt; if this part is true then it should not list "Withdrawal failed error"&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Results should be like,&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;deposit failed&lt;BR /&gt;Error 404&lt;BR /&gt;customer not found&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help me with the search.&lt;/P&gt;
&lt;P&gt;Thanks In advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 15:47:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-query-with-condition-and-comparison/m-p/627753#M218114</guid>
      <dc:creator>Dharani</dc:creator>
      <dc:date>2023-01-20T15:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Join query with condition and comparison</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-query-with-condition-and-comparison/m-p/627765#M218118</link>
      <description>&lt;P&gt;Not sure if it would be more efficient, but maybe eventstats could be helpful here?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;index=abc
| eventstats values(message) as all_messages by requestId
| where sourcetype="payment" AND log_level="Error" AND NOT match(all_messages,"insufficient balance")
| ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 14:43:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-query-with-condition-and-comparison/m-p/627765#M218118</guid>
      <dc:creator>maciep</dc:creator>
      <dc:date>2023-01-20T14:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to join query with condition and comparison?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-query-with-condition-and-comparison/m-p/627774#M218120</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/230685"&gt;@Dharani&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I understood correctly, if you don't want to see "withdrawal failed" error coming with "insufficient balance", you can try with the search I mentioned. I hope it works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=yourindex sourcetype=yorsourcetype ...
| stats count values(message) as message by requestId 
| where count &amp;lt; 2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 15:48:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-query-with-condition-and-comparison/m-p/627774#M218120</guid>
      <dc:creator>MYilmaz</dc:creator>
      <dc:date>2023-01-20T15:48:22Z</dc:date>
    </item>
  </channel>
</rss>

