<?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 result of two queries with common field ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-result-of-two-queries-with-common-field/m-p/496689#M138398</link>
    <description>&lt;P&gt;Hi ayush8878,&lt;/P&gt;

&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( source="/opt/jboss/jboss-fuse/data/log/fuse.log" "Audience value in the JWT is" ) OR ( source="/opt/jboss/jboss-fuse/data/log/access_log" ("path=/rest/cases/" "filename*=")) 
| eval filename=if(isnotnull(filename), filename, "none") 
| stats values(*) AS * by breadcrumbid filename
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2019 02:39:45 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2019-12-04T02:39:45Z</dc:date>
    <item>
      <title>Join result of two queries with common field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-result-of-two-queries-with-common-field/m-p/496688#M138397</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a use case where i need to join result of two septate logs on the basis of common field(breadcrumbId).&lt;BR /&gt;
Below is the query i used but i am not getting any results for this query &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="/opt/jboss/jboss-fuse/data/log/access_log" OR "/opt/jboss/jboss-fuse/data/log/fuse.log" ("Audience value in the JWT is*" OR ("path=/rest/cases/" "filename*=")) | stats values(*) as * by breadcrumbId | table breadcrumbId AccessedFrom
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;While if I try separately I am getting results&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Query 1:source="/opt/jboss/jboss-fuse/data/log/fuse.log" "Audience value in the JWT is" | table breadcrumbId AccessedFrom 
Query 2:source="/opt/jboss/jboss-fuse/data/log/access_log" (("path=/rest/cases/" "filename*=")) | stats values(*) as * by breadcrumbId filename
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Dec 2019 02:31:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-result-of-two-queries-with-common-field/m-p/496688#M138397</guid>
      <dc:creator>ayush8878</dc:creator>
      <dc:date>2019-12-04T02:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Join result of two queries with common field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-result-of-two-queries-with-common-field/m-p/496689#M138398</link>
      <description>&lt;P&gt;Hi ayush8878,&lt;/P&gt;

&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( source="/opt/jboss/jboss-fuse/data/log/fuse.log" "Audience value in the JWT is" ) OR ( source="/opt/jboss/jboss-fuse/data/log/access_log" ("path=/rest/cases/" "filename*=")) 
| eval filename=if(isnotnull(filename), filename, "none") 
| stats values(*) AS * by breadcrumbid filename
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 02:39:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-result-of-two-queries-with-common-field/m-p/496689#M138398</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-12-04T02:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: Join result of two queries with common field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-result-of-two-queries-with-common-field/m-p/496690#M138399</link>
      <description>&lt;P&gt;Thanks MuS but this way I am getting resuls only from fuse.log while I need data from access.log and fuse.log merged on breadcrumbid&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 03:05:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-result-of-two-queries-with-common-field/m-p/496690#M138399</guid>
      <dc:creator>ayush8878</dc:creator>
      <dc:date>2019-12-04T03:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Join result of two queries with common field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-result-of-two-queries-with-common-field/m-p/496691#M138400</link>
      <description>&lt;P&gt;It must be that the first source has no events with values for &lt;CODE&gt;filename&lt;/CODE&gt; so leave it in the &lt;CODE&gt;values(*)&lt;/CODE&gt; pile like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="YouShouldAlwaysSpecifyAnIndex" AND
((source="/opt/jboss/jboss-fuse/data/log/fuse.log" AND "Audience value in the JWT is") OR
(source="/opt/jboss/jboss-fuse/data/log/access_log" AND "path=/rest/cases/" AND "filename*="))
| stats values(*) AS * BY breadcrumbId
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Dec 2019 05:46:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-result-of-two-queries-with-common-field/m-p/496691#M138400</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-04T05:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Join result of two queries with common field ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-result-of-two-queries-with-common-field/m-p/496692#M138401</link>
      <description>&lt;P&gt;Okay, looking at the second search on the &lt;CODE&gt;access_log&lt;/CODE&gt; you use &lt;CODE&gt;"filename*="&lt;/CODE&gt; so you don't actually search for a field called &lt;CODE&gt;filename&lt;/CODE&gt;. The first thing you need to do here is create a field called &lt;CODE&gt;filename&lt;/CODE&gt; and then it will work. Assuming the &lt;CODE&gt;filename*&lt;/CODE&gt; thingy does not contain any spaces, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( source="/opt/jboss/jboss-fuse/data/log/fuse.log" "Audience value in the JWT is" ) OR ( source="/opt/jboss/jboss-fuse/data/log/access_log" ("path=/rest/cases/" "filename*=")) 
 | rex "filename[^=]*=(?&amp;lt;filename&amp;gt;[^\s]+)" 
 | eval filename=if(isnotnull(filename), filename, "none") 
 | stats values(*) AS * by breadcrumbid filename
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 20:27:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-result-of-two-queries-with-common-field/m-p/496692#M138401</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-12-04T20:27:24Z</dc:date>
    </item>
  </channel>
</rss>

