<?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: Join with &amp;quot;eventstats&amp;quot; on a non unique field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-with-quot-eventstats-quot-on-a-non-unique-field/m-p/373848#M109926</link>
    <description>&lt;P&gt;@kcollori - Can you explain how this differs from (or adds requirements to) your use case in this question?  &lt;A href="https://answers.splunk.com/answers/578302/how-to-join-2-indexes-by-common-field-respective-t.html#answer-579343"&gt;https://answers.splunk.com/answers/578302/how-to-join-2-indexes-by-common-field-respective-t.html#answer-579343&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;When trying to connect something that is non-unique, you have to create uniqueness by a time limit or some other unique characteristic.  That generally is going to require &lt;CODE&gt;streamstats&lt;/CODE&gt; rather than &lt;CODE&gt;eventstats&lt;/CODE&gt;.  &lt;/P&gt;

&lt;P&gt;You...&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;collect all the events that might be relevant,&lt;/LI&gt;
&lt;LI&gt;sort them in order (remember &lt;CODE&gt;sort 0&lt;/CODE&gt; so you don't lose any),&lt;/LI&gt;
&lt;LI&gt;copy the information you need from one type of record forward or
backward onto the other type of record using &lt;CODE&gt;streamstats&lt;/CODE&gt;,&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;get rid of any records that are now redundant &lt;/LI&gt;
&lt;LI&gt;... occasionally &lt;CODE&gt;eventstats&lt;/CODE&gt; is useful right here to collect remaining information together ... &lt;/LI&gt;
&lt;LI&gt; then calculate and present your information.&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Wed, 04 Oct 2017 13:31:52 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-10-04T13:31:52Z</dc:date>
    <item>
      <title>Join with "eventstats" on a non unique field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-with-quot-eventstats-quot-on-a-non-unique-field/m-p/373845#M109923</link>
      <description>&lt;P&gt;Hello there,&lt;/P&gt;

&lt;P&gt;I have 2 indexes &lt;STRONG&gt;[customer_id, datetime]&lt;/STRONG&gt; and &lt;STRONG&gt;[customer_id, date_of_creation, motive]&lt;/STRONG&gt; with a common field "&lt;STRONG&gt;customer_id&lt;/STRONG&gt;". I would like to perform a join of my indexes on this fields knowing that the values in each indexe can be non unique.&lt;/P&gt;

&lt;P&gt;As I don't want to use the function &lt;STRONG&gt;Join&lt;/STRONG&gt; of Splunk because of its limits, I use &lt;STRONG&gt;Eventstats&lt;/STRONG&gt; instead. But the problem is that for the non unique values, I get multivalue fields concerning &lt;STRONG&gt;datetime&lt;/STRONG&gt;, &lt;STRONG&gt;date_of_creation&lt;/STRONG&gt; and &lt;STRONG&gt;motive&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;How could I proceed to get the same result as a join would do (without using Join !) ?&lt;/P&gt;

&lt;P&gt;Thanks in advance ! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:05:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-with-quot-eventstats-quot-on-a-non-unique-field/m-p/373845#M109923</guid>
      <dc:creator>kcollori</dc:creator>
      <dc:date>2020-09-29T16:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Join with "eventstats" on a non unique field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-with-quot-eventstats-quot-on-a-non-unique-field/m-p/373846#M109924</link>
      <description>&lt;P&gt;Have you tried &lt;CODE&gt;stats&lt;/CODE&gt;?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index1 OR index=index2 customer_id=* | stats values(datetime) as datetime values(date_of_creation) as date_of_creation values(motive) as motive by customer_id | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Oct 2017 13:06:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-with-quot-eventstats-quot-on-a-non-unique-field/m-p/373846#M109924</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-10-04T13:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Join with "eventstats" on a non unique field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-with-quot-eventstats-quot-on-a-non-unique-field/m-p/373847#M109925</link>
      <description>&lt;P&gt;Yes I tried but it still gives me multivalue fields &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 13:08:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-with-quot-eventstats-quot-on-a-non-unique-field/m-p/373847#M109925</guid>
      <dc:creator>kcollori</dc:creator>
      <dc:date>2017-10-04T13:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Join with "eventstats" on a non unique field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-with-quot-eventstats-quot-on-a-non-unique-field/m-p/373848#M109926</link>
      <description>&lt;P&gt;@kcollori - Can you explain how this differs from (or adds requirements to) your use case in this question?  &lt;A href="https://answers.splunk.com/answers/578302/how-to-join-2-indexes-by-common-field-respective-t.html#answer-579343"&gt;https://answers.splunk.com/answers/578302/how-to-join-2-indexes-by-common-field-respective-t.html#answer-579343&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;When trying to connect something that is non-unique, you have to create uniqueness by a time limit or some other unique characteristic.  That generally is going to require &lt;CODE&gt;streamstats&lt;/CODE&gt; rather than &lt;CODE&gt;eventstats&lt;/CODE&gt;.  &lt;/P&gt;

&lt;P&gt;You...&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;collect all the events that might be relevant,&lt;/LI&gt;
&lt;LI&gt;sort them in order (remember &lt;CODE&gt;sort 0&lt;/CODE&gt; so you don't lose any),&lt;/LI&gt;
&lt;LI&gt;copy the information you need from one type of record forward or
backward onto the other type of record using &lt;CODE&gt;streamstats&lt;/CODE&gt;,&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;get rid of any records that are now redundant &lt;/LI&gt;
&lt;LI&gt;... occasionally &lt;CODE&gt;eventstats&lt;/CODE&gt; is useful right here to collect remaining information together ... &lt;/LI&gt;
&lt;LI&gt; then calculate and present your information.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 04 Oct 2017 13:31:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-with-quot-eventstats-quot-on-a-non-unique-field/m-p/373848#M109926</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-04T13:31:52Z</dc:date>
    </item>
  </channel>
</rss>

