<?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 do I control returned fields from a join? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-control-returned-fields-from-a-join/m-p/37478#M8388</link>
    <description>&lt;P&gt;that is the problem. I am trying to form a table with values from soucetype=one &amp;amp; sourcetype=two, but not all fields in sourcetype=two are in sourcetype=one and the table is showing me a lot of duplicate rows with common_field value and null for all other columns.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Jul 2014 18:31:34 GMT</pubDate>
    <dc:creator>edookati</dc:creator>
    <dc:date>2014-07-28T18:31:34Z</dc:date>
    <item>
      <title>How do I control returned fields from a join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-control-returned-fields-from-a-join/m-p/37474#M8384</link>
      <description>&lt;P&gt;This issue continually bites me and there's something I'm just not understanding. &lt;/P&gt;

&lt;P&gt;If I search like so:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype=one&lt;BR /&gt;
| join common_field [ search sourcetype=two ]&lt;BR /&gt;
| table one_field, one_field_two, one_field_three, two_field_one, two_field_two&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The resulting table will often be missing fields such as one_field_two and return them empty, even when the data is there. &lt;/P&gt;

&lt;P&gt;I understand that if I'm doing a " | stats" on some fields, they will definitely get returned, but could someone explain how I otherwise explicitly ensure fields from one, two or both get returned as non-empty values? I'm not doing a stats here, I just want a table and want those values returned.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:16:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-control-returned-fields-from-a-join/m-p/37474#M8384</guid>
      <dc:creator>LordVoldemort</dc:creator>
      <dc:date>2020-09-28T12:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I control returned fields from a join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-control-returned-fields-from-a-join/m-p/37475#M8385</link>
      <description>&lt;P&gt;I would do&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=one
| fields one_field one_field_two one_field_three common_field
| join common_field [ search sourcetype=two | fields common_field two_field_one, two_field_two ]
| table one_field one_field_two one_field_three two_field_one two_field_two common_field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Using the &lt;CODE&gt;fields&lt;/CODE&gt; command is a best practice; it can increase efficiency of the search and it explicitly names what you want to have returned.&lt;/P&gt;

&lt;P&gt;Is there a possibility that your events don't all have all of the fields?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2012 21:51:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-control-returned-fields-from-a-join/m-p/37475#M8385</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-08-16T21:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I control returned fields from a join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-control-returned-fields-from-a-join/m-p/37476#M8386</link>
      <description>&lt;P&gt;Can you please tell me how to filter results if few of my events don't have all of the fields...?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2014 18:12:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-control-returned-fields-from-a-join/m-p/37476#M8386</guid>
      <dc:creator>edookati</dc:creator>
      <dc:date>2014-07-28T18:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I control returned fields from a join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-control-returned-fields-from-a-join/m-p/37477#M8387</link>
      <description>&lt;P&gt;If you want to include events where all needed fields are present, try something like this (same example).&lt;/P&gt;

&lt;P&gt;sourcetype=one one_field_one=* one_field_two=* one_field_three=* common_field=* | fields one_field one_field_two one_field_three common_field&lt;BR /&gt;
| join common_field [ search sourcetype=two | fields common_field two_field_one, two_field_two ]&lt;BR /&gt;
| table one_field one_field_two one_field_three two_field_one two_field_two common_field&lt;/P&gt;

&lt;P&gt;This way all the entries selected from sourcetype=one will have non-null values of one_field one_field_two one_field_three common_field&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:11:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-control-returned-fields-from-a-join/m-p/37477#M8387</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-28T17:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I control returned fields from a join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-control-returned-fields-from-a-join/m-p/37478#M8388</link>
      <description>&lt;P&gt;that is the problem. I am trying to form a table with values from soucetype=one &amp;amp; sourcetype=two, but not all fields in sourcetype=two are in sourcetype=one and the table is showing me a lot of duplicate rows with common_field value and null for all other columns.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2014 18:31:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-control-returned-fields-from-a-join/m-p/37478#M8388</guid>
      <dc:creator>edookati</dc:creator>
      <dc:date>2014-07-28T18:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I control returned fields from a join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-control-returned-fields-from-a-join/m-p/37479#M8389</link>
      <description>&lt;P&gt;I can't put conditions on all fields.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2014 18:36:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-control-returned-fields-from-a-join/m-p/37479#M8389</guid>
      <dc:creator>edookati</dc:creator>
      <dc:date>2014-07-28T18:36:04Z</dc:date>
    </item>
  </channel>
</rss>

