<?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 make table from two queries with common field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-table-from-two-queries-with-common-field/m-p/512598#M143775</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have one index with two sources (source=source1 and source2). Both events have two common fields (common_field1 and common_field2).&lt;/P&gt;&lt;P&gt;The events with source_1 have three fields (source1_field1, common_field1, common_field2).&lt;/P&gt;&lt;P&gt;The events with source_2 have three fields (source2_field1, common_field1, common_field2).&lt;/P&gt;&lt;P&gt;I tried the following without success:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(source=source1 OR source=source2) | table common_field1, common_field2, source1_field1, source2_field1&lt;/LI-CODE&gt;&lt;P&gt;There are more events in source1 than in source2. The table should have one row per source1 event. Source2's events will be used based on the common fields. There will be many instances where the same source2 event is used.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Aug 2020 15:20:51 GMT</pubDate>
    <dc:creator>edrivera3</dc:creator>
    <dc:date>2020-08-05T15:20:51Z</dc:date>
    <item>
      <title>How to make table from two queries with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-table-from-two-queries-with-common-field/m-p/512598#M143775</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have one index with two sources (source=source1 and source2). Both events have two common fields (common_field1 and common_field2).&lt;/P&gt;&lt;P&gt;The events with source_1 have three fields (source1_field1, common_field1, common_field2).&lt;/P&gt;&lt;P&gt;The events with source_2 have three fields (source2_field1, common_field1, common_field2).&lt;/P&gt;&lt;P&gt;I tried the following without success:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(source=source1 OR source=source2) | table common_field1, common_field2, source1_field1, source2_field1&lt;/LI-CODE&gt;&lt;P&gt;There are more events in source1 than in source2. The table should have one row per source1 event. Source2's events will be used based on the common fields. There will be many instances where the same source2 event is used.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2020 15:20:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-table-from-two-queries-with-common-field/m-p/512598#M143775</guid>
      <dc:creator>edrivera3</dc:creator>
      <dc:date>2020-08-05T15:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to make table from two queries with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-table-from-two-queries-with-common-field/m-p/512603#M143776</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;could you try the next:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;index=&amp;lt;your index&amp;gt; (source=source1 OR source=source2) 
| stats values(source*) as source* by common_field1 common_field2
| table common_field1, common_field2, source1_field1, source2_field1&lt;/LI-CODE&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2020 15:43:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-table-from-two-queries-with-common-field/m-p/512603#M143776</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-08-05T15:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to make table from two queries with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-table-from-two-queries-with-common-field/m-p/512616#M143782</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;It didn't work. It produced a table with only the common fields. The other two fields were empty.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2020 16:35:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-table-from-two-queries-with-common-field/m-p/512616#M143782</guid>
      <dc:creator>edrivera3</dc:creator>
      <dc:date>2020-08-05T16:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to make table from two queries with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-table-from-two-queries-with-common-field/m-p/512632#M143789</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;can you give some sample data as this is working.&lt;/P&gt;&lt;LI-CODE lang="java"&gt;index=_internal source IN (*metrics.log,*splunkd.log) app_name="cloudgateway_metrics.app" OR component=Metrics
| stats values(app_name) as app_name values(component) as component by host index
| table host index app_name component&lt;/LI-CODE&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2020 19:57:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-table-from-two-queries-with-common-field/m-p/512632#M143789</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-08-05T19:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to make table from two queries with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-table-from-two-queries-with-common-field/m-p/513401#M144040</link>
      <description>&lt;P&gt;I ended up re-indexing those events but with with the additional fields included. It was not that bad because those events were from a mysql db connection. I did tried the Join command but it was very slow for the amount of data I was&amp;nbsp; pulling.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 16:43:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-table-from-two-queries-with-common-field/m-p/513401#M144040</guid>
      <dc:creator>edrivera3</dc:creator>
      <dc:date>2020-08-10T16:43:22Z</dc:date>
    </item>
  </channel>
</rss>

