<?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: I need a way to join two searches from different indexes in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681065#M232756</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is exactly what I did, the field name for cid in index1 is "cid" and the field name for cid in index2 is "jsonevent.cid" When I used the rename command, I only got the results from index2 and when I did not use the rename command, I only got the results from index1&lt;/P&gt;</description>
    <pubDate>Mon, 18 Mar 2024 15:48:31 GMT</pubDate>
    <dc:creator>psomeshwar</dc:creator>
    <dc:date>2024-03-18T15:48:31Z</dc:date>
    <item>
      <title>I need a way to join two searches from different indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681043#M232743</link>
      <description>&lt;P&gt;Currently, I need to join information from two different indexes. I cannot show the information as it is confidential, but I can give a general overview of what it should look like&lt;/P&gt;
&lt;P&gt;Search:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=index1 sourcetype=sourcetype1 | table ApplicationName, ApplicationVersion, ApplicationVendor, cid&lt;/LI-CODE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;ApplicationName&amp;nbsp; &amp;nbsp;ApplicationVersion&amp;nbsp; &amp;nbsp;ApplicationVendor&amp;nbsp; &amp;nbsp;cid&lt;BR /&gt;name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1.0.3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;vendor&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 78fds87324&lt;BR /&gt;...&lt;BR /&gt;...&lt;/P&gt;
&lt;P&gt;Search2:&lt;/P&gt;
&lt;P&gt;index=index2 sourcetype=sourcetype2 | table hostname, user, cid&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;hostname&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; user&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cid&lt;BR /&gt;domainname&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;username&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 78fds87324&lt;BR /&gt;...&lt;BR /&gt;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I need is a way to show the ApplicationName, ApplicationVersion, ApplicationVendor, hostname and username all in one table connected through the cid. Anyone have any ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 16:01:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681043#M232743</guid>
      <dc:creator>psomeshwar</dc:creator>
      <dc:date>2024-03-18T16:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: I need a way to join two searches from different indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681045#M232745</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/266024"&gt;@psomeshwar&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;forget the join command because your search will be very slow!&lt;/P&gt;&lt;P&gt;You should try to use the stats command.&lt;/P&gt;&lt;P&gt;Are there some rule in your join? e.g. results presnt in both the indexes or only in one of them?&lt;/P&gt;&lt;P&gt;I give you the solution without constrains:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=index1 sourcetype=sourcetype1) OR (index=index2 sourcetype=sourcetype2)
| stats 
   values(ApplicationName) AS ApplicationName
   values(ApplicationVersion) AS ApplicationVersion
   values(ApplicationVendor) AS ApplicationVendor
   values(hostname) AS hostname
   values(username) AS username
   BY cid&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 14:55:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681045#M232745</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-18T14:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: I need a way to join two searches from different indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681046#M232746</link>
      <description>&lt;P&gt;Start with this and see if that works for you - if not please try to explain with as much detail as you can as to why it doesn't work.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=index1 sourcetype=sourcetype1) OR (index=index2 sourcetype=sourcetype2 )
| stats values(ApplicationName) as ApplicationName, values(ApplicationVersion) as ApplicationVersion, values(ApplicationVendor) as ApplicationVendor, values(hostname) as hostname, values(user) as user by cid&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 18 Mar 2024 14:56:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681046#M232746</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-03-18T14:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: I need a way to join two searches from different indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681053#M232747</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thanks, this does help a little, however, there is one problem. One of the indexes has their events in a json format, and the cid is formatted as jsonevent.cid. As a result, I am only getting one side of the events, and the other is blank. Is there a way to work aroudn this&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 15:16:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681053#M232747</guid>
      <dc:creator>psomeshwar</dc:creator>
      <dc:date>2024-03-18T15:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: I need a way to join two searches from different indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681056#M232748</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/266024"&gt;@psomeshwar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;rename it to have the same field name:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=index1 sourcetype=sourcetype1) OR (index=index2 sourcetype=sourcetype2)
| rename jsonevent.cid AS cid
| stats 
   values(ApplicationName) AS ApplicationName
   values(ApplicationVersion) AS ApplicationVersion
   values(ApplicationVendor) AS ApplicationVendor
   values(hostname) AS hostname
   values(username) AS username
   BY cid&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 15:26:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681056#M232748</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-18T15:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: I need a way to join two searches from different indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681058#M232750</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried that and it didn't work. Let me show how each search works:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(index=index1 sourcetype=sourcetype1) OR (index=index2 sourcetype=sourcetype2) | stats values(ApplicationName) AS ApplicationName values(ApplicationVersion) AS ApplicationVersion values(ApplicationVendor) AS ApplicationVendor values(hostname) AS hostname values(username) AS username BY cid&lt;/LI-CODE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;cid&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ApplicationName&amp;nbsp; &amp;nbsp; ApplicationVersion&amp;nbsp; &amp;nbsp;ApplicationVendor&amp;nbsp; &amp;nbsp;hostname&amp;nbsp; &amp;nbsp;username&lt;BR /&gt;743fsd234&amp;nbsp; &amp;nbsp; &amp;nbsp;AppName&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AppVersion&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AppVendor&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; null&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;null&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(index=index1 sourcetype=sourcetype1) OR (index=index2 sourcetype=sourcetype2) | rename jsonevent.cid AS cid | stats values(ApplicationName) AS ApplicationName values(ApplicationVersion) AS ApplicationVersion values(ApplicationVendor) AS ApplicationVendor values(hostname) AS hostname values(username) AS username BY cid&lt;/LI-CODE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;cid&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ApplicationName&amp;nbsp; &amp;nbsp; ApplicationVersion&amp;nbsp; &amp;nbsp;ApplicationVendor&amp;nbsp; &amp;nbsp;hostname&amp;nbsp; &amp;nbsp;username&lt;BR /&gt;743fsd234&amp;nbsp; &amp;nbsp; &amp;nbsp;null&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; null&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;null&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;hostname&amp;nbsp; &amp;nbsp;username&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 16:01:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681058#M232750</guid>
      <dc:creator>psomeshwar</dc:creator>
      <dc:date>2024-03-18T16:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: I need a way to join two searches from different indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681062#M232753</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/266024"&gt;@psomeshwar&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;what are the exact fieldnames of cid in both the indexes?&lt;/P&gt;&lt;P&gt;if they are cid and jsonevent.cid (it's a supposition, please confirm that), please try again the above solution, using the correct field name in the rename command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 15:42:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681062#M232753</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-18T15:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: I need a way to join two searches from different indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681065#M232756</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is exactly what I did, the field name for cid in index1 is "cid" and the field name for cid in index2 is "jsonevent.cid" When I used the rename command, I only got the results from index2 and when I did not use the rename command, I only got the results from index1&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 15:48:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681065#M232756</guid>
      <dc:creator>psomeshwar</dc:creator>
      <dc:date>2024-03-18T15:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: I need a way to join two searches from different indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681066#M232757</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/266024"&gt;@psomeshwar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=index1 sourcetype=sourcetype1) OR (index=index2 sourcetype=sourcetype2)
| eval cid=coalesce(cid,jsonevent.cid)
| stats 
   values(ApplicationName) AS ApplicationName
   values(ApplicationVersion) AS ApplicationVersion
   values(ApplicationVendor) AS ApplicationVendor
   values(hostname) AS hostname
   values(username) AS username
   BY cid&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 15:54:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681066#M232757</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-18T15:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: I need a way to join two searches from different indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681068#M232758</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I managed to get it to work. The solution I used was:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(index=index1 sourcetype=sourcetype1) OR (index=index2 sourcetype=sourcetype2)
| rename cid as cid1
| rename jsonevent.cid as cid2
| eval jcid = coalesce(cid1, cid2)
| stats stats values(ApplicationName) AS ApplicationName values(ApplicationVersion) AS ApplicationVersion values(ApplicationVendor) AS ApplicationVendor values(hostname) AS hostname values(username) AS username BY jcid
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Thanks, this thread helped me a lot&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 18:44:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681068#M232758</guid>
      <dc:creator>psomeshwar</dc:creator>
      <dc:date>2024-03-18T18:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: I need a way to join two searches from different indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681071#M232759</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/266024"&gt;@psomeshwar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 16:39:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-a-way-to-join-two-searches-from-different-indexes/m-p/681071#M232759</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-18T16:39:36Z</dc:date>
    </item>
  </channel>
</rss>

