<?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: Compare values from same field in different events to all other events in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Compare-values-from-same-field-in-different-events-to-all-other/m-p/613145#M106098</link>
    <description>&lt;P&gt;See if this helps&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eventstats count by val1 val2
| where count &amp;gt; 1
| fields - count&lt;/LI-CODE&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;eventstats&lt;/FONT&gt; command counts the number of rows with the same values for val1 and val2.&amp;nbsp; Then we eliminate the rows with a count of 1 and discard the count field.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Sep 2022 21:06:32 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2022-09-14T21:06:32Z</dc:date>
    <item>
      <title>Compare values from same field in different events to all other events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Compare-values-from-same-field-in-different-events-to-all-other/m-p/613142#M106095</link>
      <description>&lt;P&gt;&lt;BR /&gt;So I'm trying to get all events where &lt;STRONG&gt;val1&lt;/STRONG&gt;+&lt;STRONG&gt;val2&lt;/STRONG&gt; are also in another event from the table. In the example below, I would need as output &lt;STRONG&gt;row 0&lt;/STRONG&gt; and &lt;STRONG&gt;row 1&lt;/STRONG&gt;, because both &lt;STRONG&gt;val1&lt;/STRONG&gt; and &lt;STRONG&gt;val2&lt;/STRONG&gt; match.&amp;nbsp; &lt;STRONG&gt;Row 3&lt;/STRONG&gt; and &lt;STRONG&gt;4&lt;/STRONG&gt; match on &lt;STRONG&gt;val1&lt;/STRONG&gt; but not on &lt;STRONG&gt;val2&lt;/STRONG&gt;, and &lt;STRONG&gt;row 1&lt;/STRONG&gt; and &lt;STRONG&gt;2&lt;/STRONG&gt; match on &lt;STRONG&gt;val2&lt;/STRONG&gt; but not on&lt;STRONG&gt; val1&lt;/STRONG&gt;, so those events should get excluded. (Also I need time column to stay as I need to do some other operations with it)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="100.00000000000001%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%"&gt;row#&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;time&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;val1&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;val2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%"&gt;0&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;YYYY-MM-DD&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;A&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;X&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%"&gt;1&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;YYYY-MM-DD&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;A&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;X&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%"&gt;2&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;YYYY-MM-DD&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;B&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;X&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%"&gt;3&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;YYYY-MM-DD&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;C&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Y&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%"&gt;4&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;YYYY-MM-DD&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;C&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;X&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%"&gt;5&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;YYYY-MM-DD&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;A&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Z&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To solve this I've been trying:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| foreach val1
       [eval test=if(val1+val2=val1+val2, "same", "not")] &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;'&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;' = '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I end up getting with either "not" in all cases,&amp;nbsp; or "same" in others even tho both values are not actually the same&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 14:44:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Compare-values-from-same-field-in-different-events-to-all-other/m-p/613142#M106095</guid>
      <dc:creator>sg2</dc:creator>
      <dc:date>2022-09-15T14:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values from same field in different events to all other events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Compare-values-from-same-field-in-different-events-to-all-other/m-p/613145#M106098</link>
      <description>&lt;P&gt;See if this helps&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eventstats count by val1 val2
| where count &amp;gt; 1
| fields - count&lt;/LI-CODE&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;eventstats&lt;/FONT&gt; command counts the number of rows with the same values for val1 and val2.&amp;nbsp; Then we eliminate the rows with a count of 1 and discard the count field.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 21:06:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Compare-values-from-same-field-in-different-events-to-all-other/m-p/613145#M106098</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-09-14T21:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values from same field in different events to all other events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Compare-values-from-same-field-in-different-events-to-all-other/m-p/613152#M106100</link>
      <description>&lt;P&gt;FYI: foreach command only looks at fields in the SAME event, not across events. As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;says, use eventstats to calculate count as needed - that command will leave the original events untouched, so you have access to all fields still.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 22:44:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Compare-values-from-same-field-in-different-events-to-all-other/m-p/613152#M106100</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-09-14T22:44:49Z</dc:date>
    </item>
  </channel>
</rss>

