<?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 connect two different indexes by unique item code showing count / percent (with match) &amp; (without match)? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-connect-two-different-indexes-by-unique-item-code-showing/m-p/308868#M92624</link>
    <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=index1 other parts ) OR (index=index2 other parts)
| eval itemCode=coalesce(item1,item2)
| stats dc(index) as reportedBy by itemCode
| stats count as Count by reportedBy | eventstats sum(Count) as Total
| eval Percent=round(Count*100/Total,2)
| eval ItemType=if(reportedBy=2,"Common in Both Indexes","Unique in Both Indexes")
| table ItemType Count Percent
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 02 Apr 2018 00:58:36 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-04-02T00:58:36Z</dc:date>
    <item>
      <title>How to connect two different indexes by unique item code showing count / percent (with match) &amp; (without match)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-connect-two-different-indexes-by-unique-item-code-showing/m-p/308863#M92619</link>
      <description>&lt;UL&gt;
&lt;LI&gt;I have 2 indexes. &lt;/LI&gt;
&lt;LI&gt;1st index (Index1) has a unique item code (Item1) for an item when it enters a process. &lt;/LI&gt;
&lt;LI&gt;2nd index (Index2) should have the same unique item code (Item2) when the item exits the process. &lt;/LI&gt;
&lt;LI&gt;I want to produce report showing a count / percent where the  (Index1.Item1 &lt;STRONG&gt;=&lt;/STRONG&gt; Index2.Item2) &amp;amp; where (Index1.Item1 &lt;STRONG&gt;&amp;lt;&amp;gt;&lt;/STRONG&gt; Index2.Item2).&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Please show examples of SPL if possible and thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 30 Mar 2018 16:10:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-connect-two-different-indexes-by-unique-item-code-showing/m-p/308863#M92619</guid>
      <dc:creator>timothytruax</dc:creator>
      <dc:date>2018-03-30T16:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect two different indexes by unique item code showing count / percent (with match) &amp; (without match)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-connect-two-different-indexes-by-unique-item-code-showing/m-p/308864#M92620</link>
      <description>&lt;P&gt;Hey@timothytruax,&lt;/P&gt;

&lt;P&gt;Try something like this,&lt;BR /&gt;
if item1 and item2 has same fields then&lt;BR /&gt;
index=index1 OR index=index2 |  rename item2 as item1 | stats count dc(index) AS dc by item1 | where dc&amp;gt;1 | stats count .&lt;BR /&gt;
This will give you the count of items having common values.&lt;/P&gt;

&lt;P&gt;Let me know if this helps!! &lt;/P&gt;</description>
      <pubDate>Fri, 30 Mar 2018 16:36:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-connect-two-different-indexes-by-unique-item-code-showing/m-p/308864#M92620</guid>
      <dc:creator>deepashri_123</dc:creator>
      <dc:date>2018-03-30T16:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect two different indexes by unique item code showing count / percent (with match) &amp; (without match)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-connect-two-different-indexes-by-unique-item-code-showing/m-p/308865#M92621</link>
      <description>&lt;P&gt;Hey deepashri_123 -&lt;BR /&gt;
What if there is possibility of duplicates in Index1 of the Item1 and possibility of duplicates in Index2 of Item2?&lt;BR /&gt;
I want to be sure that Index1.Item1 is actually present in Index2.Item2.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Mar 2018 17:58:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-connect-two-different-indexes-by-unique-item-code-showing/m-p/308865#M92621</guid>
      <dc:creator>timothytruax</dc:creator>
      <dc:date>2018-03-30T17:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect two different indexes by unique item code showing count / percent (with match) &amp; (without match)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-connect-two-different-indexes-by-unique-item-code-showing/m-p/308866#M92622</link>
      <description>&lt;P&gt;This query should give you exact count of items having values in both indexes. &lt;BR /&gt;
Even if there is duplication. Just to confirm you need count of items common or event count?&lt;BR /&gt;
Event count will need some other approach.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Mar 2018 18:23:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-connect-two-different-indexes-by-unique-item-code-showing/m-p/308866#M92622</guid>
      <dc:creator>deepashri_123</dc:creator>
      <dc:date>2018-03-30T18:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect two different indexes by unique item code showing count / percent (with match) &amp; (without match)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-connect-two-different-indexes-by-unique-item-code-showing/m-p/308867#M92623</link>
      <description>&lt;P&gt;Hey deepashri_123 -&lt;BR /&gt;
I tried entering this one below; naturally with my fields and it did not work - it just shows a count = 0.&lt;/P&gt;

&lt;P&gt;index=index1 OR index=index2 | rename item2 as item1 | stats count dc(index) AS dc by item1 | where dc&amp;gt;1 | stats count .&lt;/P&gt;

&lt;P&gt;Any other suggestions?  I continue to try different approaches.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Apr 2018 23:45:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-connect-two-different-indexes-by-unique-item-code-showing/m-p/308867#M92623</guid>
      <dc:creator>timothytruax</dc:creator>
      <dc:date>2018-04-01T23:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect two different indexes by unique item code showing count / percent (with match) &amp; (without match)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-connect-two-different-indexes-by-unique-item-code-showing/m-p/308868#M92624</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=index1 other parts ) OR (index=index2 other parts)
| eval itemCode=coalesce(item1,item2)
| stats dc(index) as reportedBy by itemCode
| stats count as Count by reportedBy | eventstats sum(Count) as Total
| eval Percent=round(Count*100/Total,2)
| eval ItemType=if(reportedBy=2,"Common in Both Indexes","Unique in Both Indexes")
| table ItemType Count Percent
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Apr 2018 00:58:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-connect-two-different-indexes-by-unique-item-code-showing/m-p/308868#M92624</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-04-02T00:58:36Z</dc:date>
    </item>
  </channel>
</rss>

