<?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 How to combine two Splunk queries and extract the matching values of one of the fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-Splunk-queries-and-extract-the-matching/m-p/455452#M128783</link>
    <description>&lt;P&gt;I have two splunk queries and both have one common field with different values in each query. I need to combine both the queries and bring out the common values of the matching field in the result. I can create the lookup for one of the queries and correlate the matching field values in the second query but trying to do without lookup within the splunk query.&lt;/P&gt;

&lt;P&gt;Example:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Query 1:  index=abc.......| table field1, field2, field3
field1 have values 123, 434, 124, 567

Query 2: index=abc.......| table field1, test2,test3
field1 have values 123, 434, 865,524
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need the resultant to have the field with matching values in both queries like field1 as 123,434. Can you help me with this?&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jul 2018 01:52:00 GMT</pubDate>
    <dc:creator>arrangineni</dc:creator>
    <dc:date>2018-07-25T01:52:00Z</dc:date>
    <item>
      <title>How to combine two Splunk queries and extract the matching values of one of the fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-Splunk-queries-and-extract-the-matching/m-p/455452#M128783</link>
      <description>&lt;P&gt;I have two splunk queries and both have one common field with different values in each query. I need to combine both the queries and bring out the common values of the matching field in the result. I can create the lookup for one of the queries and correlate the matching field values in the second query but trying to do without lookup within the splunk query.&lt;/P&gt;

&lt;P&gt;Example:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Query 1:  index=abc.......| table field1, field2, field3
field1 have values 123, 434, 124, 567

Query 2: index=abc.......| table field1, test2,test3
field1 have values 123, 434, 865,524
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need the resultant to have the field with matching values in both queries like field1 as 123,434. Can you help me with this?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 01:52:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-Splunk-queries-and-extract-the-matching/m-p/455452#M128783</guid>
      <dc:creator>arrangineni</dc:creator>
      <dc:date>2018-07-25T01:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two Splunk queries and extract the matching values of one of the fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-Splunk-queries-and-extract-the-matching/m-p/455453#M128784</link>
      <description>&lt;P&gt;Have you tried using join?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc query 1
| table field1, field2, field3 
| join type=inner field1 [search (index=abc query 2) | fields field1, test2, test3]
| table field1, field2, field3, test2, test3
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Jul 2018 03:26:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-Splunk-queries-and-extract-the-matching/m-p/455453#M128784</guid>
      <dc:creator>rahmanazhar</dc:creator>
      <dc:date>2018-07-25T03:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two Splunk queries and extract the matching values of one of the fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-Splunk-queries-and-extract-the-matching/m-p/455454#M128785</link>
      <description>&lt;P&gt;Thanks Rahman, Its working for me now. But I get the same results when I give the type=outer as well. What kind of difference will it make to my results.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 14:55:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-Splunk-queries-and-extract-the-matching/m-p/455454#M128785</guid>
      <dc:creator>arrangineni</dc:creator>
      <dc:date>2018-07-25T14:55:21Z</dc:date>
    </item>
  </channel>
</rss>

