<?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 Differences between two sourcetype according to a field in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Differences-between-two-sourcetype-according-to-a-field/m-p/134003#M27536</link>
    <description>&lt;P&gt;I need to know what events are on the sourcetype A that are not in the sourcetype B.&lt;/P&gt;

&lt;P&gt;the query must evaluate more than 1 million events&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;consecutive   consecutive
000234456     000234456
000977832     000977832
000383748     000183846
000773732     000773732
000859484     000339274
000272849     000646473
000263664     000263664
000183846
000339274
000646473
sourcetypeA   sourcetypeB
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 20 Sep 2014 17:25:18 GMT</pubDate>
    <dc:creator>lufermalgo</dc:creator>
    <dc:date>2014-09-20T17:25:18Z</dc:date>
    <item>
      <title>Differences between two sourcetype according to a field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Differences-between-two-sourcetype-according-to-a-field/m-p/134003#M27536</link>
      <description>&lt;P&gt;I need to know what events are on the sourcetype A that are not in the sourcetype B.&lt;/P&gt;

&lt;P&gt;the query must evaluate more than 1 million events&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;consecutive   consecutive
000234456     000234456
000977832     000977832
000383748     000183846
000773732     000773732
000859484     000339274
000272849     000646473
000263664     000263664
000183846
000339274
000646473
sourcetypeA   sourcetypeB
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 20 Sep 2014 17:25:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Differences-between-two-sourcetype-according-to-a-field/m-p/134003#M27536</guid>
      <dc:creator>lufermalgo</dc:creator>
      <dc:date>2014-09-20T17:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Differences between two sourcetype according to a field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Differences-between-two-sourcetype-according-to-a-field/m-p/134004#M27537</link>
      <description>&lt;P&gt;if the value exists in both the sourcetypes do they exist more than once in each sourcetype? If not, below query might help you &lt;/P&gt;

&lt;P&gt;sourcetype=sourcetypeA OR sourcetype=sourcetypeB | stats count by consecutive | search count &amp;lt; 2&lt;/P&gt;</description>
      <pubDate>Sat, 20 Sep 2014 22:42:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Differences-between-two-sourcetype-according-to-a-field/m-p/134004#M27537</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2014-09-20T22:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Differences between two sourcetype according to a field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Differences-between-two-sourcetype-according-to-a-field/m-p/134005#M27538</link>
      <description>&lt;P&gt;Replacing the &lt;CODE&gt;count&lt;/CODE&gt; with a &lt;CODE&gt;dc(sourcetype)&lt;/CODE&gt; would lift that restriction... however, the question implies that events in B but not in A aren't interesting, which would not be distinguishable with &lt;CODE&gt;count&lt;/CODE&gt; or &lt;CODE&gt;dc(sourcetype)&lt;/CODE&gt; alone. Here's how to solve that:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=A OR sourcetype=B | stats values(sourcetype) as sourcetypes by consecutive | search sourcetypes=A NOT sourcetypes=B
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note, this will work for millions of events but might break, slow down, or at least consume a lot of memory for millions of distinct values of &lt;CODE&gt;consecutive&lt;/CODE&gt;... &lt;CODE&gt;stats&lt;/CODE&gt; basically has to keep millions of buckets around in that case.&lt;BR /&gt;
Is there any relationship between the timestamps of A and B? If so, using &lt;CODE&gt;transaction&lt;/CODE&gt; with short spans might use massively less memory:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=A OR sourcetype=B | transaction consecutive maxspan=1m keepevicted=t | search sourcetype=A NOT sourcetypes=B
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In theory there's also this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=A NOT [search sourcetype=B | dedup consecutive | fields consecutive]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But that again might (will) break for millions of distinct &lt;CODE&gt;consecutive&lt;/CODE&gt; values.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Sep 2014 00:14:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Differences-between-two-sourcetype-according-to-a-field/m-p/134005#M27538</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-09-21T00:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Differences between two sourcetype according to a field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Differences-between-two-sourcetype-according-to-a-field/m-p/134006#M27539</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/172708"&gt;@martin_mueller&lt;/a&gt; and @gpradeepkumarreddy for their contributions. &lt;/P&gt;

&lt;P&gt;Take one of the recommendations of &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/172708"&gt;@martin_mueller&lt;/a&gt; and Realize the following query: &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=ilt sourcetype=boleta_generada OR sourcetype=boleta_indexado TIPO_DOCUMENTO="BE PEDIDO" CAMPANA&amp;gt;="201411"   | dedup CONSECUTIVO WF_ESTADO   | eventstats values(sourcetype) as sourcetypes by CONSECUTIVO   | search sourcetypes=boleta_generada NOT sourcetypes=boleta_indexado | stats count&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Effectively this give me the expected result but equally was very slow to deliver the answer.&lt;/P&gt;

&lt;P&gt;Martin_mueller question about whether I could create a transaction with the &lt;CODE&gt;transaction&lt;/CODE&gt; command, could not, as the events in the &lt;CODE&gt;sourcetype=boleta_indexado&lt;/CODE&gt; can crearce after many days. &lt;/P&gt;

&lt;P&gt;I want to share with you that I did another query graph and I'm getting basically what I would like to integrate other bar to show me the difference: &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=ilt sourcetype=boleta_generada OR sourcetype=boleta_indexado TIPO_DOCUMENTO="BE PEDIDO" (CAMPANA&amp;gt;="201408") | dedup CONSECUTIVO WF_ESTADO | chart count over CAMPANA by WF_ESTADO | sort -WF_ESTADO&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;chart:&lt;BR /&gt;
&lt;A href="https://drive.google.com/file/d/0B1HsOnBT01xZWDcyY2dTNUUwZFE/edit?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/0B1HsOnBT01xZWDcyY2dTNUUwZFE/edit?usp=sharing&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The WF_ESTADO field contains the values​​: &lt;/P&gt;

&lt;P&gt;GENERATED &lt;BR /&gt;
INDEXED &lt;/P&gt;

&lt;P&gt;I would like the other bar that was called MISSING paint.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:38:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Differences-between-two-sourcetype-according-to-a-field/m-p/134006#M27539</guid>
      <dc:creator>lufermalgo</dc:creator>
      <dc:date>2020-09-28T17:38:54Z</dc:date>
    </item>
  </channel>
</rss>

