<?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 do I display fields in two separate indexes in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-display-fields-in-two-separate-indexes/m-p/291124#M165030</link>
    <description>&lt;P&gt;I have two separate indexes for example index A and index B.  I need to display one field from index A and one field from index B in columns for each field next to each other.  These two fields are NOT related but entirely different&lt;/P&gt;

&lt;P&gt;Please kindly help?&lt;/P&gt;</description>
    <pubDate>Mon, 20 Nov 2017 18:21:26 GMT</pubDate>
    <dc:creator>epeeran</dc:creator>
    <dc:date>2017-11-20T18:21:26Z</dc:date>
    <item>
      <title>How do I display fields in two separate indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-display-fields-in-two-separate-indexes/m-p/291124#M165030</link>
      <description>&lt;P&gt;I have two separate indexes for example index A and index B.  I need to display one field from index A and one field from index B in columns for each field next to each other.  These two fields are NOT related but entirely different&lt;/P&gt;

&lt;P&gt;Please kindly help?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 18:21:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-display-fields-in-two-separate-indexes/m-p/291124#M165030</guid>
      <dc:creator>epeeran</dc:creator>
      <dc:date>2017-11-20T18:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I display fields in two separate indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-display-fields-in-two-separate-indexes/m-p/291125#M165031</link>
      <description>&lt;P&gt;Hi epeeran,&lt;/P&gt;

&lt;P&gt;basically you can do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=a OR index=b
| eval id=coalesce(fieldA, fieldB)
| stats values(*) AS * by id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will take either values from &lt;CODE&gt;fieldA&lt;/CODE&gt; or &lt;CODE&gt;fliedB&lt;/CODE&gt; as &lt;CODE&gt;id&lt;/CODE&gt; and the &lt;CODE&gt;stats&lt;/CODE&gt; will group everything by &lt;CODE&gt;id&lt;/CODE&gt;.&lt;BR /&gt;
You can also read this answer &lt;A href="https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html"&gt;https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html&lt;/A&gt; to learn more about this topic.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 18:52:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-display-fields-in-two-separate-indexes/m-p/291125#M165031</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2017-11-20T18:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I display fields in two separate indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-display-fields-in-two-separate-indexes/m-p/291126#M165032</link>
      <description>&lt;P&gt;Do you need to correlate the values of &lt;CODE&gt;fieldA&lt;/CODE&gt; with the values of &lt;CODE&gt;fieldB&lt;/CODE&gt; somehow? Or just list them in two columns, side by side?&lt;BR /&gt;
If the latter, then this should work:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=A OR index=B fieldA=* OR fieldB=* | stats values(fieldA) AS fieldA values(fieldB) AS fieldB&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The &lt;CODE&gt;stats values()&lt;/CODE&gt; will dedup the contents of the respective field. If you don't want to dedup and would prefer to list all values, including duplicates, then try this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=A OR index=B fieldA=* OR fieldB=* | stats list(fieldA) AS fieldA list(fieldB) AS fieldB&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If you need to actually correlate the values of &lt;CODE&gt;fieldA&lt;/CODE&gt; with the values of &lt;CODE&gt;fieldB&lt;/CODE&gt;, then you'll need to identify something they have in common that links events from index A with events from index B. For example, maybe they both have a matching field called &lt;CODE&gt;UUID&lt;/CODE&gt;. In that case, something like this should work:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=A OR index=B fieldA=* OR fieldB=* UUID=*| stats values(fieldA) AS fieldA values(fieldB) AS fieldB BY UUID&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 21:08:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-display-fields-in-two-separate-indexes/m-p/291126#M165032</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-11-20T21:08:23Z</dc:date>
    </item>
  </channel>
</rss>

