<?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: How to search and display two sources in a table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-display-two-sources-in-a-table/m-p/264670#M79479</link>
    <description>&lt;P&gt;Can you share the query that you used? Also, could you confirm if there are matching data available in both the sourcetypes?&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jul 2016 18:28:14 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-07-19T18:28:14Z</dc:date>
    <item>
      <title>How to search and display two sources in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-display-two-sources-in-a-table/m-p/264666#M79475</link>
      <description>&lt;P&gt;I found this thread, but wasn't able to get it to work for me:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/74245/joining-data-from-2-data-sources-in-splunk.html" target="_blank"&gt;https://answers.splunk.com/answers/74245/joining-data-from-2-data-sources-in-splunk.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I have 2 sources that I would like to display in a table. The two sources use 2 columns as the "join" to know that it's the same data.&lt;/P&gt;

&lt;P&gt;In other words i have:&lt;BR /&gt;
Source A, Column_A, Column_B (as well as other columns)&lt;BR /&gt;
Source B, Column_A, Column_C (as well as other columns)&lt;BR /&gt;
Column_A=Column_A and Column_B=Column_C (has to be both matching, not just one set of columns or the others)&lt;/P&gt;

&lt;P&gt;Based on the link above, I have tried:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index* (sourcetype=A OR sourcetype=B)
| rename Column_C as Column_B
| table 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Maybe it doesn't matter, but I'm hung up on how Slunk knows what to join on if I don't tell it.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:16:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-display-two-sources-in-a-table/m-p/264666#M79475</guid>
      <dc:creator>pmhelfrich</dc:creator>
      <dc:date>2020-09-29T10:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and display two sources in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-display-two-sources-in-a-table/m-p/264667#M79476</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index* (sourcetype=A OR sourcetype=B)
| eval common_col=coalesce(Column_C,Column_B)
| table common_col list all other fields that you need here
| stats first(*) as * by common_col
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Jul 2016 22:18:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-display-two-sources-in-a-table/m-p/264667#M79476</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-07-18T22:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and display two sources in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-display-two-sources-in-a-table/m-p/264668#M79477</link>
      <description>&lt;P&gt;Unfortunately this didn't work. I'm still only getting columns from one of the tables. The other tables columns are just showing blank.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 17:29:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-display-two-sources-in-a-table/m-p/264668#M79477</guid>
      <dc:creator>pmhelfrich</dc:creator>
      <dc:date>2016-07-19T17:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and display two sources in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-display-two-sources-in-a-table/m-p/264669#M79478</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=A | join column_A column_B [ search sourcetype=B | rename column_C AS column_B  | fields column_A column_B and other columns ] | table ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Jul 2016 18:24:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-display-two-sources-in-a-table/m-p/264669#M79478</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-19T18:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and display two sources in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-display-two-sources-in-a-table/m-p/264670#M79479</link>
      <description>&lt;P&gt;Can you share the query that you used? Also, could you confirm if there are matching data available in both the sourcetypes?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 18:28:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-display-two-sources-in-a-table/m-p/264670#M79479</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-07-19T18:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and display two sources in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-display-two-sources-in-a-table/m-p/264671#M79480</link>
      <description>&lt;P&gt;The query that I gave above is the exact query with renamed values. I just checked and there is definitely data available in both sourcetypes and that would qualify for a "join." When I run what you gave and add |search common_col=(value), It pulls two rows, and each has the others data blank. In other words, the query is looking at both sourcetypes, just not combining anything.&lt;/P&gt;

&lt;P&gt;My understanding is the columns you specify in the |table command won't effect the results and is just for display, correct?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 21:13:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-display-two-sources-in-a-table/m-p/264671#M79480</guid>
      <dc:creator>pmhelfrich</dc:creator>
      <dc:date>2016-07-19T21:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and display two sources in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-display-two-sources-in-a-table/m-p/264672#M79481</link>
      <description>&lt;P&gt;When you say "other columns," does that mean they have to be columns that match on each table, or just any column that I want from sourcetype B?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 21:28:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-display-two-sources-in-a-table/m-p/264672#M79481</guid>
      <dc:creator>pmhelfrich</dc:creator>
      <dc:date>2016-07-19T21:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and display two sources in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-display-two-sources-in-a-table/m-p/264673#M79482</link>
      <description>&lt;P&gt;Would you mind trying this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index* (sourcetype=A OR sourcetype=B)
 | eval common_col=coalesce(Column_C,Column_B)
 | table common_col list all other fields that you need here
 | stats values(*) as * by common_col
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Jul 2016 22:00:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-display-two-sources-in-a-table/m-p/264673#M79482</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-07-19T22:00:05Z</dc:date>
    </item>
  </channel>
</rss>

