<?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: How to look for two values that occur at the same time per host? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-look-for-two-values-that-occur-at-the-same-time-per-host/m-p/623537#M216757</link>
    <description>&lt;P&gt;Because SPL is a streaming language, you'll have to explain and illustrate raw data (anonymize as needed), illustrate how rule_id1 and rule_id2 relate to such data.&lt;/P&gt;&lt;P&gt;For example, suppose your raw data contains some events with a field rule_id1, some others with a field rule_id2; suppose the first alert fires up when rule_id1 exists, and the second alert fires up when rule_id2 exists plus the simultaneity condition you described. &amp;nbsp;Further assume that "same-ish time" means test in 5-minute bins. &amp;nbsp;Then, your second alert can be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| bin span=5m _time
| stats values(rules_id1) values(rules_id2) by _time host
| where isnull('values(rules_id1)') AND isnotnull('values(rules_id2)')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This example shows how a solution is closely related to details of data and individual criteria.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Dec 2022 08:07:51 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2022-12-07T08:07:51Z</dc:date>
    <item>
      <title>How to look for two values that occur at the same time per host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-look-for-two-values-that-occur-at-the-same-time-per-host/m-p/623474#M216740</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;I am trying to figure out the following:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;1. If an alert for rule_id1 occurs at the same time on the same host as an alert for rule_id2 then don’t report the alert on rule_id2.&lt;BR /&gt;2. Otherwise report alerts on rule_id2&lt;/P&gt;
&lt;P&gt;I have triend the if(match) and if(like) method and neither are able to yield the results I am hoping for.&amp;nbsp; Also not sure how to incorporate the time check as well to ensure the fired at the same-ish time.&lt;/P&gt;
&lt;P&gt;Any and all help greatly appreciated!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 17:47:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-look-for-two-values-that-occur-at-the-same-time-per-host/m-p/623474#M216740</guid>
      <dc:creator>AssureSec</dc:creator>
      <dc:date>2022-12-06T17:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to look for two values that occur at the same time per host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-look-for-two-values-that-occur-at-the-same-time-per-host/m-p/623537#M216757</link>
      <description>&lt;P&gt;Because SPL is a streaming language, you'll have to explain and illustrate raw data (anonymize as needed), illustrate how rule_id1 and rule_id2 relate to such data.&lt;/P&gt;&lt;P&gt;For example, suppose your raw data contains some events with a field rule_id1, some others with a field rule_id2; suppose the first alert fires up when rule_id1 exists, and the second alert fires up when rule_id2 exists plus the simultaneity condition you described. &amp;nbsp;Further assume that "same-ish time" means test in 5-minute bins. &amp;nbsp;Then, your second alert can be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| bin span=5m _time
| stats values(rules_id1) values(rules_id2) by _time host
| where isnull('values(rules_id1)') AND isnotnull('values(rules_id2)')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This example shows how a solution is closely related to details of data and individual criteria.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 08:07:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-look-for-two-values-that-occur-at-the-same-time-per-host/m-p/623537#M216757</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-12-07T08:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to look for two values that occur at the same time per host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-look-for-two-values-that-occur-at-the-same-time-per-host/m-p/623595#M216775</link>
      <description>&lt;P&gt;So basically ruled_id1 and 2 are two different events.&amp;nbsp; What we want to do is make sure that if there is a event for rule_id1 and an event for rule_id2 on the same host, at the same time, we don't display those and only display the events where only rule_id2 has an event.&amp;nbsp; If both rule_id1 and rule_id2 have an event at the same time for the same host, those are false positives.&lt;BR /&gt;&lt;BR /&gt;rule_id1 and rule_id2 are the same field just different values. How to find when they occur at the same-ish time and on the same host/user and then only display the unique occurrences of rule_id2 or what is left.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 14:38:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-look-for-two-values-that-occur-at-the-same-time-per-host/m-p/623595#M216775</guid>
      <dc:creator>AssureSec</dc:creator>
      <dc:date>2022-12-07T14:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to look for two values that occur at the same time per host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-look-for-two-values-that-occur-at-the-same-time-per-host/m-p/623613#M216781</link>
      <description>&lt;P&gt;Assume that the field with values rule_id1 and 2 is called "rule", and the condition "same-ish" can be implemented with search in 5-minute bins, this should work:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex rule IN (rule_id1, rule_id2)
| bin span=5m _time
| stats values(rule) as rule by _time host
| where rule == "rule_id2" AND NOT rule == "rule_id1"&lt;/LI-CODE&gt;&lt;P&gt;The last filter reads a little silly if it is in another language. &amp;nbsp;But SPL's equality operator returns true when any value in a multivalue if the other value is single valued. &amp;nbsp;A more semantically explicit expression can be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where isnotnull(mvfind(rule, "rule_id2")) AND isnull(mvfind(rule, "rule_id1"))&lt;/LI-CODE&gt;&lt;P&gt;In plain English, the search says: give me data containing values of both rule_id1 and rule_id2 in each 5-minute calendar intervals for each host, then find out which host and interval combinations contain only rule_id2 and not rule_id1. &amp;nbsp;A key test of suitability for this solution will be whether x-calendar interval is a good enough approximation of "same-ish". (What I am getting at is that a calendar interval is not a rolling time window.)&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 17:25:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-look-for-two-values-that-occur-at-the-same-time-per-host/m-p/623613#M216781</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-12-07T17:25:39Z</dc:date>
    </item>
  </channel>
</rss>

