<?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 Two Queries That Return Results Do not Return Results After Join in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Two-Queries-That-Return-Results-Do-not-Return-Results-After-Join/m-p/422776#M191055</link>
    <description>&lt;P&gt;I have written two individual queries that both return the expected results.&lt;BR /&gt;
A. &lt;BR /&gt;
tag=&lt;EM&gt;tag name&lt;/EM&gt; &lt;BR /&gt;
location="&lt;EM&gt;location name&lt;/EM&gt;"&lt;BR /&gt;
message="&lt;EM&gt;error message&lt;/EM&gt;"&lt;BR /&gt;
status=400&lt;BR /&gt;
| rex field=&lt;EM&gt;raw "&lt;EM&gt;string from log&lt;/EM&gt; (?\w+[@]\S+)@&lt;EM&gt;string from log&lt;/EM&gt;"&lt;BR /&gt;
| rex field=_raw "&lt;/EM&gt;(?\w+)]"&lt;/P&gt;

&lt;P&gt;B.&lt;BR /&gt;
tag=&lt;EM&gt;tag name&lt;/EM&gt; &lt;BR /&gt;
"&lt;EM&gt;string from log&lt;/EM&gt;"&lt;BR /&gt;
"\"status\":400"&lt;BR /&gt;
"&lt;EM&gt;string from log&lt;/EM&gt;"&lt;BR /&gt;
| rex field=&lt;EM&gt;field name&lt;/EM&gt; "_(?\w+)"&lt;/P&gt;

&lt;P&gt;However, when I join the two queries, no results are returned.&lt;BR /&gt;
C.&lt;BR /&gt;
tag=&lt;EM&gt;tag name&lt;/EM&gt;&lt;BR /&gt;
location="&lt;EM&gt;location name&lt;/EM&gt;"&lt;BR /&gt;
message="&lt;EM&gt;error message&lt;/EM&gt;"&lt;BR /&gt;
status=400&lt;BR /&gt;
| rex field=&lt;EM&gt;raw "&lt;EM&gt;string from log&lt;/EM&gt;  (?\w+[@]\S+)@&lt;EM&gt;string from log&lt;/EM&gt;"&lt;BR /&gt;
| rex field=_raw "&lt;/EM&gt;(?\w+)]"&lt;BR /&gt;
| join type=inner login_dye&lt;BR /&gt;
[search&lt;BR /&gt;
tag=&lt;EM&gt;tag name&lt;/EM&gt; &lt;BR /&gt;
"&lt;EM&gt;string from log&lt;/EM&gt;"&lt;BR /&gt;
"\"status\":400"&lt;BR /&gt;
"&lt;EM&gt;string from log&lt;/EM&gt;"&lt;BR /&gt;
| rex field=&lt;EM&gt;field name&lt;/EM&gt; "_(?\w+)"&lt;BR /&gt;
| eval Date=strftime(_time, "%m-%d-%y")]&lt;BR /&gt;
| eval user_email="'".user_email."',"&lt;BR /&gt;
| dedup Date, user_email&lt;BR /&gt;
| table Date, user_email&lt;/P&gt;

&lt;P&gt;The main search returns a large number of results. However, the sub-search returns a relatively small number of results, so the sub-search should not be timing out. I also get no messages indicating such, and no other errors or messages.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 01:33:48 GMT</pubDate>
    <dc:creator>ryanmcdermott12</dc:creator>
    <dc:date>2020-09-30T01:33:48Z</dc:date>
    <item>
      <title>Two Queries That Return Results Do not Return Results After Join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-Queries-That-Return-Results-Do-not-Return-Results-After-Join/m-p/422776#M191055</link>
      <description>&lt;P&gt;I have written two individual queries that both return the expected results.&lt;BR /&gt;
A. &lt;BR /&gt;
tag=&lt;EM&gt;tag name&lt;/EM&gt; &lt;BR /&gt;
location="&lt;EM&gt;location name&lt;/EM&gt;"&lt;BR /&gt;
message="&lt;EM&gt;error message&lt;/EM&gt;"&lt;BR /&gt;
status=400&lt;BR /&gt;
| rex field=&lt;EM&gt;raw "&lt;EM&gt;string from log&lt;/EM&gt; (?\w+[@]\S+)@&lt;EM&gt;string from log&lt;/EM&gt;"&lt;BR /&gt;
| rex field=_raw "&lt;/EM&gt;(?\w+)]"&lt;/P&gt;

&lt;P&gt;B.&lt;BR /&gt;
tag=&lt;EM&gt;tag name&lt;/EM&gt; &lt;BR /&gt;
"&lt;EM&gt;string from log&lt;/EM&gt;"&lt;BR /&gt;
"\"status\":400"&lt;BR /&gt;
"&lt;EM&gt;string from log&lt;/EM&gt;"&lt;BR /&gt;
| rex field=&lt;EM&gt;field name&lt;/EM&gt; "_(?\w+)"&lt;/P&gt;

&lt;P&gt;However, when I join the two queries, no results are returned.&lt;BR /&gt;
C.&lt;BR /&gt;
tag=&lt;EM&gt;tag name&lt;/EM&gt;&lt;BR /&gt;
location="&lt;EM&gt;location name&lt;/EM&gt;"&lt;BR /&gt;
message="&lt;EM&gt;error message&lt;/EM&gt;"&lt;BR /&gt;
status=400&lt;BR /&gt;
| rex field=&lt;EM&gt;raw "&lt;EM&gt;string from log&lt;/EM&gt;  (?\w+[@]\S+)@&lt;EM&gt;string from log&lt;/EM&gt;"&lt;BR /&gt;
| rex field=_raw "&lt;/EM&gt;(?\w+)]"&lt;BR /&gt;
| join type=inner login_dye&lt;BR /&gt;
[search&lt;BR /&gt;
tag=&lt;EM&gt;tag name&lt;/EM&gt; &lt;BR /&gt;
"&lt;EM&gt;string from log&lt;/EM&gt;"&lt;BR /&gt;
"\"status\":400"&lt;BR /&gt;
"&lt;EM&gt;string from log&lt;/EM&gt;"&lt;BR /&gt;
| rex field=&lt;EM&gt;field name&lt;/EM&gt; "_(?\w+)"&lt;BR /&gt;
| eval Date=strftime(_time, "%m-%d-%y")]&lt;BR /&gt;
| eval user_email="'".user_email."',"&lt;BR /&gt;
| dedup Date, user_email&lt;BR /&gt;
| table Date, user_email&lt;/P&gt;

&lt;P&gt;The main search returns a large number of results. However, the sub-search returns a relatively small number of results, so the sub-search should not be timing out. I also get no messages indicating such, and no other errors or messages.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:33:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-Queries-That-Return-Results-Do-not-Return-Results-After-Join/m-p/422776#M191055</guid>
      <dc:creator>ryanmcdermott12</dc:creator>
      <dc:date>2020-09-30T01:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Two Queries That Return Results Do not Return Results After Join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-Queries-That-Return-Results-Do-not-Return-Results-After-Join/m-p/422777#M191056</link>
      <description>&lt;P&gt;you are performing an inner type join, which means you are looking only for common results in both the searches.&lt;BR /&gt;
if you remove your join field login_dye are you receiving results?&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 17:29:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-Queries-That-Return-Results-Do-not-Return-Results-After-Join/m-p/422777#M191056</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-07-31T17:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Two Queries That Return Results Do not Return Results After Join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-Queries-That-Return-Results-Do-not-Return-Results-After-Join/m-p/422778#M191057</link>
      <description>&lt;P&gt;Hi ryanmcdermott1208,&lt;BR /&gt;
at first check if there are common values in both the searches fir the field login_die.&lt;BR /&gt;
then try to tranform in uppercase (o lowercase) both the login_die fields and retry.&lt;BR /&gt;
at least check if the number of results of the subsearch is greater than 50,000, because there's this limit in subsearches.&lt;/P&gt;

&lt;P&gt;Anyway, join isn't a performant command, try something different: use stats count.&lt;BR /&gt;
I could help you but you should copy your searches using the Code Sample button (the one neat the attach button), because otherwise I cannot correctly read your question. &lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:33:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-Queries-That-Return-Results-Do-not-Return-Results-After-Join/m-p/422778#M191057</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-30T01:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Two Queries That Return Results Do not Return Results After Join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-Queries-That-Return-Results-Do-not-Return-Results-After-Join/m-p/422779#M191058</link>
      <description>&lt;P&gt;thank you sukisen, but i think removing the join would not return the results i need. i only want the subset of the main query that includes the results from the sub query.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;tag=tag name
location="location name"
message="error message"
status=400
| rex field=raw "string from log (?\w+[@]\S+)@string from log"
| rex field=raw "(?\w+)]"
| join type=inner login_dye
[search
tag=tag name 
"string from log"
"\"status\":400"
"string from log"
| rex field=field name "(?\w+)"
| eval Date=strftime(_time, "%m-%d-%y")]
| eval user_email="'".user_email."',"
| dedup Date, user_email
| table Date, user_email
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Aug 2019 15:00:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-Queries-That-Return-Results-Do-not-Return-Results-After-Join/m-p/422779#M191058</guid>
      <dc:creator>ryanmcdermott12</dc:creator>
      <dc:date>2019-08-01T15:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Two Queries That Return Results Do not Return Results After Join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-Queries-That-Return-Results-Do-not-Return-Results-After-Join/m-p/422780#M191059</link>
      <description>&lt;P&gt;hank you giuseppe. the main query returns over 50k results, but the sub-query does not. i should have included that the values being extracted for "login_dye" are strictly numerical. the value being extracted from the main query matches the value being extracted from the sub-query.&lt;/P&gt;

&lt;P&gt;here is the query in code sample:&lt;BR /&gt;
tag=tagname&lt;BR /&gt;
location="location name"&lt;BR /&gt;
message="error message"&lt;BR /&gt;
status=400&lt;BR /&gt;
| rex field=raw "string from log (?\w+[@]\S+)@string from log"&lt;BR /&gt;
| rex field=raw "(?\w+)]"&lt;BR /&gt;
| join type=inner login_dye&lt;BR /&gt;
[search&lt;BR /&gt;
tag=tag name &lt;BR /&gt;
"string from log"&lt;BR /&gt;
"\"status\":400"&lt;BR /&gt;
"string from log"&lt;BR /&gt;
| rex field=field name "(?\w+)"&lt;BR /&gt;
| eval Date=strftime(_time, "%m-%d-%y")]&lt;BR /&gt;
| eval user_email="'".user_email."',"&lt;BR /&gt;
| dedup Date, user_email&lt;BR /&gt;
| table Date, user_email&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:34:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-Queries-That-Return-Results-Do-not-Return-Results-After-Join/m-p/422780#M191059</guid>
      <dc:creator>ryanmcdermott12</dc:creator>
      <dc:date>2020-09-30T01:34:26Z</dc:date>
    </item>
  </channel>
</rss>

