<?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: trying to compare two sources and extract these ones that do not have SysMon in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/674937#M230998</link>
    <description>&lt;P&gt;It's not clear how you distinguish your "sources". Your first search simply pulls data from two separate indexes while the second one does something completely strange.&lt;/P&gt;&lt;P&gt;Please describe what constitutes those sets of sources you want to calculate difference from.&lt;/P&gt;</description>
    <pubDate>Sat, 20 Jan 2024 22:18:28 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-01-20T22:18:28Z</dc:date>
    <item>
      <title>trying to compare two sources and extract these ones that do not have SysMon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/674935#M230997</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;I have a challenge finding and isolating the unique hosts out of two sources (DHCL and SysMon in my case)&lt;/P&gt;&lt;P&gt;I did try the following but it did work as expected:&lt;/P&gt;&lt;P&gt;EXAMPLE 1:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index=dhcp_source_index | stats count by host | eval source="dhcp" | append [ search index=sysmon_index | stats count by host | eval source="sysmon" ] | stats values(source) as sources by host | where mvcount(sources)=1 AND sources="dhcp"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;EXAMPLE 2:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index=my_index | dedup host, source | stats list(source) as sources by host | append [search index=my_index | stats latest(_time) as last_seen by host] | eventstats max(last_seen) as last_seen by host | where mvcount(sources)=1 | table host, last_seen&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The numbers from the manual findings and the above SPLs differ&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jan 2024 20:38:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/674935#M230997</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2024-01-20T20:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: trying to compare two sources and extract these ones that do not have SysMon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/674937#M230998</link>
      <description>&lt;P&gt;It's not clear how you distinguish your "sources". Your first search simply pulls data from two separate indexes while the second one does something completely strange.&lt;/P&gt;&lt;P&gt;Please describe what constitutes those sets of sources you want to calculate difference from.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jan 2024 22:18:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/674937#M230998</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-01-20T22:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: trying to compare two sources and extract these ones that do not have SysMon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/674940#M231000</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;Thanks for the reply.&lt;/P&gt;&lt;P&gt;Please, ignore both searches.&lt;/P&gt;&lt;P&gt;What I want to pull out the total unique assets in the DHCP source. I then want to be able to compare to the totals of unique assets in the SysMon source and output these assets that do not have SysMon present.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jan 2024 01:06:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/674940#M231000</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2024-01-21T01:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: trying to compare two sources and extract these ones that do not have SysMon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/674951#M231003</link>
      <description>&lt;P&gt;Sure. But how do you define "assets"? How do you differentiate between them?&lt;/P&gt;&lt;P&gt;Because while you can use the general approach of combining two separate searches (either by means of append or multisearch) with additional field to classify your results into one of two sets, there might be more effective ways in specific cases.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jan 2024 11:37:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/674951#M231003</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-01-21T11:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: trying to compare two sources and extract these ones that do not have SysMon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/674987#M231009</link>
      <description>&lt;P&gt;Two questions.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;In addition to comparison of host values for the purpose of exclusion, is there any other information you want to extract from sysmon_index? &amp;nbsp;I will assume no.&lt;/LI&gt;&lt;LI&gt;Is presence in sysmon_index necessary and sufficient for exclusion? &amp;nbsp;I will assume yes.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;With these assumptions, you don't need stats. &amp;nbsp;The following subsearch should suffice:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=dhcp_source_index NOT
  [search index=sysmon_index
  | stats values(host) as host]&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 22 Jan 2024 04:25:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/674987#M231009</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-01-22T04:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: trying to compare two sources and extract these ones that do not have SysMon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675057#M231015</link>
      <description>&lt;P&gt;Thanks for the reply &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sure, there will be a third column containing only assets that are not seen in both sources simultaneously and&amp;nbsp; in addition at the end of the list there should be Totals of these assets.&lt;/P&gt;&lt;P&gt;Would you be able to develop a sample solution for this, please?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 14:53:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675057#M231015</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2024-01-22T14:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: trying to compare two sources and extract these ones that do not have SysMon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675102#M231023</link>
      <description>&lt;P&gt;But what do you mean by asset? What in your data tells you that this is one "asset" and this is another one? Is it the host field or some other field within your data? Or any combination of fields?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 18:27:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675102#M231023</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-01-22T18:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: trying to compare two sources and extract these ones that do not have SysMon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675108#M231026</link>
      <description>&lt;P&gt;Hi, thanks for the reply.&lt;/P&gt;&lt;P&gt;To simplify it let us say we have two lists of items of same type it could be anything.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can we compare both lists and list only the subset of items not common to both lists.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;D&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 19:30:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675108#M231026</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2024-01-22T19:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: trying to compare two sources and extract these ones that do not have SysMon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675127#M231027</link>
      <description>&lt;P&gt;You can see my &lt;A href="https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/674987/highlight/true#M231009" target="_self"&gt;earlier comment&lt;/A&gt;. &amp;nbsp;Essentially you don't need append/stats for this job.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=dhcp_source_index NOT
  [search index=sysmon_index
  | stats values(host) as host]&lt;/LI-CODE&gt;&lt;P&gt;If you only want to know which DHCP hosts &amp;nbsp;are not in sysmon_index, add stats values(host) or stats count by host &amp;nbsp;after this search.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 00:07:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675127#M231027</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-01-23T00:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: trying to compare two sources and extract these ones that do not have SysMon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675129#M231029</link>
      <description>&lt;P&gt;Thanks for your reply &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, your search did not provide the results I wanted. After executing the separate searches and abstract manually the result differs from the resultant of your search. Please do try it out.&lt;/P&gt;&lt;P&gt;After lots of try/error I finally found the one that does the trick. It is by using 'set diff' command. I will provide my solution tomorrow for everyone to use.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 00:28:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675129#M231029</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2024-01-23T00:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: trying to compare two sources and extract these ones that do not have SysMon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675136#M231031</link>
      <description>&lt;P&gt;set diff does not give host that do not have SysMon as the original question specifies. &amp;nbsp;So, you want to know which sets of hosts are unique to each search, and not care that the only come from dhcp_source_index? (That is why I was asking very specific clarification questions, and stated clear assumptions of what my search is intended to do.)&lt;/P&gt;&lt;P&gt;Again, set is an expensive operation. &amp;nbsp;You should be able to use stats to achieve it. &amp;nbsp;The following is equivalent to set diff:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=dhcp_source_index OR index=sysmon_index
| stats values(index) as index by host
| where mvcount(index) == 1&lt;/LI-CODE&gt;&lt;P&gt;Maybe you have some requirements that you are not telling us?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 06:17:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675136#M231031</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-01-23T06:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: trying to compare two sources and extract these ones that do not have SysMon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675142#M231034</link>
      <description>&lt;P&gt;Thanks for the reply &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Agree to disagree.&lt;/P&gt;&lt;P&gt;If you look at the very beginning of my post I asked:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"I have a challenge finding and isolating the unique hosts out of two sources"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I think this is clear and SysMon and DHCP were just an example. Nothing concrete.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;During the communication I have reiterated this statement.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Apologies if misunderstood.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks all for your help.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 07:44:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675142#M231034</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2024-01-23T07:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: trying to compare two sources and extract these ones that do not have SysMon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675160#M231041</link>
      <description>&lt;P&gt;Honestly, I have no idea what was the point of this thread. You asked some vague question (apparently wih some assumptions known only to you). People tried to help you by asking more precise questions (because often there is more than one way to do something in Splunk and depending on the data and requirements some solutions may be way way more effective than others) and you kept throwing more and more remarks leading nowhere.&lt;/P&gt;&lt;P&gt;Even if you simply asked it as a purely theoretical exercise - to find out what approaches you can take to solve this kind of problem, you should have said so clearly - the descriptive answer about general possible approaches is something completely different than a solution to a specific problem.&lt;/P&gt;&lt;P&gt;And no, the set operators are not very effective and are very rarely used since there are usually much better solutions - either filtering out by a subsearch as &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt; showed or by classifying, statsing and filtering (or even faster - tstatsing if you can use indexed fields).&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 11:52:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675160#M231041</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-01-23T11:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: trying to compare two sources and extract these ones that do not have SysMon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675197#M231054</link>
      <description>&lt;P&gt;Frustration is the least emotional state I wanted to achieve here. Apologies!&lt;/P&gt;&lt;P&gt;I still believe it was not me confusing people, I just wanted help with simply being able to compare two datasets and printing out the only hosts seen in one of the data sources. if that sounds confusing then again apologies.&lt;/P&gt;&lt;P&gt;I have been a member for some time now and always admired all the help given here.&lt;/P&gt;&lt;P&gt;I have tested all solutions provided so far, and seen no results (it might be my fault).&lt;/P&gt;&lt;P&gt;The only solution that provided me with the results I want was the following for all to use.&lt;/P&gt;&lt;P&gt;I agree (do not have great knowledge around set command as of now) set might not be as efficient as other commands bet here is what worked for me.&lt;/P&gt;&lt;P&gt;| set diff&lt;BR /&gt;[| tstats count where source_1 by host | table host]&lt;BR /&gt;[| tstats count where source_2 by host | table host]&lt;BR /&gt;That SPL provides a list of all of the hosts not seen in source_2&lt;/P&gt;&lt;P&gt;At the end of the day it is important for people to get some working examples. They are testing and either working or not working. Silence is gold time to time and no one wants frustration waves. I was not meant to do any harm. Been in the industry for a long time enough to realize we all different and have different emotions.&lt;/P&gt;&lt;P&gt;Please, by all means if you can create something that would prove me wrong or anything better than set command for the community to use.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 16:08:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675197#M231054</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2024-01-23T16:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: trying to compare two sources and extract these ones that do not have SysMon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675239#M231069</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;| set diff&lt;BR /&gt;[| tstats count where source_1 by host | table host]&lt;BR /&gt;[| tstats count where source_2 by host | table host]&lt;/P&gt;&lt;P&gt;That SPL provides a list of all of the hosts not seen in source_2&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The search is not wrong but the last statement is inaccurate because &lt;FONT face="courier new,courier"&gt;set diff&lt;/FONT&gt; as shown produces a list of all hosts in source_1 not seen in source_2, plus all hosts in source_2 not seen in source_1. (The statement is correct only if hosts in source_2 is a subset of that in source_1. &amp;nbsp;Maybe this is a condition known in your use case?) &amp;nbsp;So, it is equivalent to the search I posted in&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675136/highlight/true#M231031" target="_self"&gt;this one&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;To get list of only those hosts in source_1 that are not in source_2, use my search in&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/674987/highlight/true#M231009" target="_self"&gt;this earlier one&lt;/A&gt;&amp;nbsp;or, as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;suggested, improve it with tstats like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats values(host) as host
  where source_1 NOT
  [tstats values(host) as host
   where source_2]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If&amp;nbsp;hosts in source_2 is a subset of that in source_1 as may be the case, this method will produce the exact same result, and will still be more efficient.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 23:56:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675239#M231069</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-01-23T23:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: trying to compare two sources and extract these ones that do not have SysMon</title>
      <link>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675319#M231083</link>
      <description>&lt;P&gt;Thanks very much for the solution &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Much appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 22:12:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/trying-to-compare-two-sources-and-extract-these-ones-that-do-not/m-p/675319#M231083</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2024-01-24T22:12:54Z</dc:date>
    </item>
  </channel>
</rss>

