<?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 read data from two different indexes? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-data-from-two-different-indexes/m-p/617434#M214573</link>
    <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index="itsi_grouped_alerts" source="ABC" sourcetype=itsi_notable:group) OR (index="itsi_notable_audit" source="Notable Event Audit" sourcetype=itsi_notable:audit)
``` Create a field which has event_id or itsi_group_id ```
| eval _id=coalesce(event_id, itsi_group_id)
``` Gather the values from the two indexes by _id ```
| stats values(*) as * by _id&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 17 Oct 2022 22:01:27 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-10-17T22:01:27Z</dc:date>
    <item>
      <title>How to read data from two different indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-data-from-two-different-indexes/m-p/617424#M214569</link>
      <description>&lt;P&gt;Hello Team, I'm new to splunk, trying to get some insight/help for the below issue&lt;/P&gt;
&lt;P&gt;I'm trying to read data from 2 different indexes and create a consolidated table. The scenarios here is the field values are same but the field names are different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;index="itsi_grouped_alerts" source="ABC" sourcetype=itsi_notable:group&amp;nbsp;| where &lt;STRONG&gt;itsi_group_id="8a84c088-ba86-4d0a"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;index="itsi_notable_audit" source="Notable Event Audit" sourcetype=itsi_notable:audit&amp;nbsp;&lt;STRONG&gt;event_id="8a84c088-ba86-4d0a"&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;When i try to use a join command, doesn't gives any error.&lt;/P&gt;
&lt;P&gt;Appreciate your assistance&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 21:38:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-data-from-two-different-indexes/m-p/617424#M214569</guid>
      <dc:creator>splkjk</dc:creator>
      <dc:date>2022-10-17T21:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to read data from two different indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-data-from-two-different-indexes/m-p/617434#M214573</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index="itsi_grouped_alerts" source="ABC" sourcetype=itsi_notable:group) OR (index="itsi_notable_audit" source="Notable Event Audit" sourcetype=itsi_notable:audit)
``` Create a field which has event_id or itsi_group_id ```
| eval _id=coalesce(event_id, itsi_group_id)
``` Gather the values from the two indexes by _id ```
| stats values(*) as * by _id&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 17 Oct 2022 22:01:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-data-from-two-different-indexes/m-p/617434#M214573</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-10-17T22:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to read data from two different indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-data-from-two-different-indexes/m-p/617448#M214575</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; for the inputs, which provided me some breakthrough, but the output is publishing just the content ( field names and values) from second index, we can see the fields names from first index but no values. So my requirement was, to read the event values from both indexes and if the field values&amp;nbsp; for both events are equal, then push the output of both index in a table format..&lt;/P&gt;&lt;P&gt;Appreciate your inputs...&lt;BR /&gt;Once again thanks so much for your inputs...&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 22:36:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-data-from-two-different-indexes/m-p/617448#M214575</guid>
      <dc:creator>splkjk</dc:creator>
      <dc:date>2022-10-17T22:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to read data from two different indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-data-from-two-different-indexes/m-p/617483#M214591</link>
      <description>&lt;P&gt;It sounds like your ids don't quite match across the two indexes - are there trailing/leading spaces? do they exactly match including case e.g. "A" is not equal to "a"? does the _id field contain the expected values from events in both indexes? Please check your data&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 06:26:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-data-from-two-different-indexes/m-p/617483#M214591</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-10-18T06:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to read data from two different indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-data-from-two-different-indexes/m-p/617520#M214602</link>
      <description>&lt;P&gt;Values totally match, A=A.., there is no trailing/leading zero or space&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;itsi_group_id=&lt;/SPAN&gt;&lt;SPAN&gt;"8a84c088-ba86"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;event_id=&lt;/SPAN&gt;&lt;SPAN&gt;"8a84c088-ba86d"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 18 Oct 2022 13:04:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-data-from-two-different-indexes/m-p/617520#M214602</guid>
      <dc:creator>splkjk</dc:creator>
      <dc:date>2022-10-18T13:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to read data from two different indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-data-from-two-different-indexes/m-p/617532#M214606</link>
      <description>&lt;P&gt;You should be able to do it with a join-command. Can you show us what you've tried?&lt;BR /&gt;&lt;BR /&gt;One way to go about it would be to rename either of the fields so that both fields have the same name:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="itsi_grouped_alerts" source="ABC" sourcetype=itsi_notable:group 
| where itsi_group_id="8a84c088-ba86-4d0a"
| stats values(*) as * by itsi_group_id
| join itsi_group_id 
    [ search index="itsi_notable_audit" source="Notable Event Audit" sourcetype=itsi_notable:audit event_id="8a84c088-ba86-4d0a"
    | stats values(*) as * by event_id
    | rename event_id as itsi_group_id ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alternatively, you can keep the original names and use the where clause in the join-command:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="itsi_grouped_alerts" source="ABC" sourcetype=itsi_notable:group 
| where itsi_group_id="8a84c088-ba86-4d0a"
| stats values(*) as * by itsi_group_id
| join left=L right=R where L.itsi_group_id = R.event_id
    [ search index="itsi_notable_audit" source="Notable Event Audit" sourcetype=itsi_notable:audit event_id="8a84c088-ba86-4d0a"
    | stats values(*) as * by event_id ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See the &lt;A href="https://docs.splunk.com/Documentation/Splunk/9.0.1/SearchReference/Join" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt; for more information on the join-command.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 13:35:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-data-from-two-different-indexes/m-p/617532#M214606</guid>
      <dc:creator>paksoi</dc:creator>
      <dc:date>2022-10-18T13:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to read data from two different indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-data-from-two-different-indexes/m-p/617588#M214622</link>
      <description>&lt;P&gt;These don't match - one has a "d" at the end&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 20:40:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-data-from-two-different-indexes/m-p/617588#M214622</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-10-18T20:40:39Z</dc:date>
    </item>
  </channel>
</rss>

