<?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: Performing Set operation using splunk query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Performing-Set-operation-using-splunk-query/m-p/673908#M230709</link>
    <description>&lt;P&gt;As you noted that "someLog" is just a text identifier to connect the two sets. &amp;nbsp;I deduce that "consistencies" and "inconsistencies" are also mere text identifiers, not associated with a specific field.&lt;/P&gt;&lt;P&gt;If this is correct, your problem can be clarified as: Find values of someField that only occurs in events that contains identifier term "inconsistencies" and that do not contain identifier term "consistencies". &amp;nbsp;This way, it is easy to translate into SPL:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype="my_source" someLog (consistencies OR inconsistencies)
| eval consistent_or_not = if(searchmatch("consistencies"), "consistent", "inconsistent")
| stats values(someField) as someField by consistent_or_not
| stats values(consistent_or_not) as consistent_or_not by someField
| where mvcount(consistent_or_not) &amp;lt; 2 AND consistent_or_not == "inconsistent"&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jan 2024 07:53:01 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2024-01-11T07:53:01Z</dc:date>
    <item>
      <title>Performing Set operation using splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Performing-Set-operation-using-splunk-query/m-p/673781#M230684</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I have two queries, that have a common field someField&lt;/P&gt;&lt;P&gt;one helps me find inconsistencies:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype="my_source" someLog inconsistencies &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;other helps me find consistencies&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype="my_source" someLog consistencies &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This gives me both consistencies and inconsistencies:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype="my_source" someLog &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Note that&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;someLog&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;is just a text used an identifier that's common for both the queries.&lt;/P&gt;&lt;P&gt;if the someField was logged as inconsistent it can be logged as consistent in the future.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I find those values of someField that are truly inconsistent in a given time frame, retrospectively?i.e. if currently values are inconsistent I want to be able to search (in the past or future relative to the current search) those values that are truly inconsistent - not part of the consistent results in that time frame&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 12:57:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Performing-Set-operation-using-splunk-query/m-p/673781#M230684</guid>
      <dc:creator>darkhorse91</dc:creator>
      <dc:date>2024-01-10T12:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Performing Set operation using splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Performing-Set-operation-using-splunk-query/m-p/673908#M230709</link>
      <description>&lt;P&gt;As you noted that "someLog" is just a text identifier to connect the two sets. &amp;nbsp;I deduce that "consistencies" and "inconsistencies" are also mere text identifiers, not associated with a specific field.&lt;/P&gt;&lt;P&gt;If this is correct, your problem can be clarified as: Find values of someField that only occurs in events that contains identifier term "inconsistencies" and that do not contain identifier term "consistencies". &amp;nbsp;This way, it is easy to translate into SPL:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype="my_source" someLog (consistencies OR inconsistencies)
| eval consistent_or_not = if(searchmatch("consistencies"), "consistent", "inconsistent")
| stats values(someField) as someField by consistent_or_not
| stats values(consistent_or_not) as consistent_or_not by someField
| where mvcount(consistent_or_not) &amp;lt; 2 AND consistent_or_not == "inconsistent"&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 07:53:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Performing-Set-operation-using-splunk-query/m-p/673908#M230709</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-01-11T07:53:01Z</dc:date>
    </item>
  </channel>
</rss>

