<?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 populate fields from two indexes that share one field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-fields-from-two-indexes-that-share-one-field/m-p/450389#M171359</link>
    <description>&lt;P&gt;not sure why or what you need to &lt;CODE&gt;coalesce&lt;/CODE&gt; if the split by field is the same ...&lt;BR /&gt;
&lt;CODE&gt;index = a or index = b name=* |stats values(field2) as fields2 values(field3) as field3 values(field4) as field4 values(field5) as field5 by name&lt;/CODE&gt; &lt;/P&gt;</description>
    <pubDate>Thu, 09 May 2019 19:17:24 GMT</pubDate>
    <dc:creator>adonio</dc:creator>
    <dc:date>2019-05-09T19:17:24Z</dc:date>
    <item>
      <title>How to populate fields from two indexes that share one field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-fields-from-two-indexes-that-share-one-field/m-p/450388#M171358</link>
      <description>&lt;P&gt;Hello, &lt;BR /&gt;
I asked this question yesterday but didn't get the right solution. I have two indexes with different fields and only share one common field, I want to have a table where it display some fields form both indexes. So far, it displays fields from one index only, not sure what I'm doing wrong. Here is my attempt. &lt;/P&gt;

&lt;P&gt;Note: field 2 and field 3 from index=1 , field 4 and field 5 from index=2 , common field is name &lt;/P&gt;

&lt;P&gt;index=1 OR index=2 &lt;BR /&gt;
|eval name=coalescce(name1,name2) &lt;BR /&gt;
|stats values(field2) as fields2 values(field3) as field3 values(field4) as field4 values(field5) as field5 by name &lt;/P&gt;

&lt;P&gt;thank you in advance!!! &lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 15:57:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-populate-fields-from-two-indexes-that-share-one-field/m-p/450388#M171358</guid>
      <dc:creator>maryamchar</dc:creator>
      <dc:date>2019-05-09T15:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to populate fields from two indexes that share one field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-fields-from-two-indexes-that-share-one-field/m-p/450389#M171359</link>
      <description>&lt;P&gt;not sure why or what you need to &lt;CODE&gt;coalesce&lt;/CODE&gt; if the split by field is the same ...&lt;BR /&gt;
&lt;CODE&gt;index = a or index = b name=* |stats values(field2) as fields2 values(field3) as field3 values(field4) as field4 values(field5) as field5 by name&lt;/CODE&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 19:17:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-populate-fields-from-two-indexes-that-share-one-field/m-p/450389#M171359</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2019-05-09T19:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to populate fields from two indexes that share one field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-fields-from-two-indexes-that-share-one-field/m-p/450390#M171360</link>
      <description>&lt;P&gt;I need coalesce because it's the same field but named differently in each index. however, they both have same data. The query you provided didn't work &lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 21:26:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-populate-fields-from-two-indexes-that-share-one-field/m-p/450390#M171360</guid>
      <dc:creator>maryamchar</dc:creator>
      <dc:date>2019-05-09T21:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to populate fields from two indexes that share one field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-fields-from-two-indexes-that-share-one-field/m-p/450391#M171361</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;You should use join command to correlate data from one index to data in other index.&lt;/P&gt;

&lt;P&gt;index=1 | stats c by name1, field2, field3 | rename name1 as name2| join name2 [| search index=2 | stats c by name2, field4, field5]&lt;/P&gt;

&lt;P&gt;other example : index=_internal | stats c by host sourcetype | join type=left host [ | search index=_audit | stats c by host source]&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:27:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-populate-fields-from-two-indexes-that-share-one-field/m-p/450391#M171361</guid>
      <dc:creator>PowerPacked</dc:creator>
      <dc:date>2020-09-30T00:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to populate fields from two indexes that share one field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-fields-from-two-indexes-that-share-one-field/m-p/450392#M171362</link>
      <description>&lt;P&gt;Thank you!!! It worked!!&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 18:19:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-populate-fields-from-two-indexes-that-share-one-field/m-p/450392#M171362</guid>
      <dc:creator>maryamchar</dc:creator>
      <dc:date>2019-05-13T18:19:22Z</dc:date>
    </item>
  </channel>
</rss>

