<?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: I am trying to check for a field value is unchanged in last two day or if possible two business days. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/608060#M211423</link>
    <description>&lt;P&gt;Something like this?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;| stats max(_time) as _time latest(&lt;SPAN&gt;status&lt;/SPAN&gt;) as &lt;SPAN&gt;status&amp;nbsp;&lt;/SPAN&gt;by host &lt;BR /&gt;| eval now=now()&lt;BR /&gt;| convert ctime(now) as day_of_week timeformat="&lt;SPAN&gt;%w"&lt;BR /&gt;&lt;/SPAN&gt;| eval day_of_week_variable=case(day_of_week=0 OR day_of_week=1, 2,day_of_week=6 or day_of_week=2,1,1=1,0)&lt;BR /&gt;| eval day_age_of_last_message=(now()-_time)/60/60/24-day_of_week_variable)&lt;BR /&gt;| eval reboot_required=if(day_age_of_last_message&amp;gt;2,"reboot required", "not required")&lt;/PRE&gt;&lt;P&gt;You would need to provide more info on what your source data looks like to make something more specific.&lt;/P&gt;&lt;P&gt;What field are you using to determine status?&lt;/P&gt;&lt;P&gt;If the current weekday is monday or sunday (0 or 1) then it takes -2 days, if it is saturday or tuesday (6,2) then it takes -1 days off from the ticker.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Aug 2022 10:58:09 GMT</pubDate>
    <dc:creator>martinpu</dc:creator>
    <dc:date>2022-08-03T10:58:09Z</dc:date>
    <item>
      <title>How to check that a field value is unchanged in last two day or if possible two business days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/608046#M211418</link>
      <description>&lt;P&gt;I am checking for reboot required, if yes, since how long is the status unchanged from reboot required yes. Logic I am waiting for atleast 2 business days before I send alert to user to reboot his machine. Thank you so much for you help.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I did check an answer but did not get it.&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Splunk-Search/Get-data-from-the-last-2-business-days/m-p/539517" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Splunk-Search/Get-data-from-the-last-2-business-days/m-p/539517&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 15:19:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/608046#M211418</guid>
      <dc:creator>vgiri8</dc:creator>
      <dc:date>2022-08-03T15:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to check for a field value is unchanged in last two day or if possible two business days.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/608060#M211423</link>
      <description>&lt;P&gt;Something like this?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;| stats max(_time) as _time latest(&lt;SPAN&gt;status&lt;/SPAN&gt;) as &lt;SPAN&gt;status&amp;nbsp;&lt;/SPAN&gt;by host &lt;BR /&gt;| eval now=now()&lt;BR /&gt;| convert ctime(now) as day_of_week timeformat="&lt;SPAN&gt;%w"&lt;BR /&gt;&lt;/SPAN&gt;| eval day_of_week_variable=case(day_of_week=0 OR day_of_week=1, 2,day_of_week=6 or day_of_week=2,1,1=1,0)&lt;BR /&gt;| eval day_age_of_last_message=(now()-_time)/60/60/24-day_of_week_variable)&lt;BR /&gt;| eval reboot_required=if(day_age_of_last_message&amp;gt;2,"reboot required", "not required")&lt;/PRE&gt;&lt;P&gt;You would need to provide more info on what your source data looks like to make something more specific.&lt;/P&gt;&lt;P&gt;What field are you using to determine status?&lt;/P&gt;&lt;P&gt;If the current weekday is monday or sunday (0 or 1) then it takes -2 days, if it is saturday or tuesday (6,2) then it takes -1 days off from the ticker.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 10:58:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/608060#M211423</guid>
      <dc:creator>martinpu</dc:creator>
      <dc:date>2022-08-03T10:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to check that a field value is unchanged in last two day or if possible two business days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/609150#M211814</link>
      <description>&lt;P&gt;&lt;SPAN&gt;index=my_index sourcetype=my_sourcetype isDecommissioned="false" isUninstalled="false" | stats max(_time) as _time latest(threatRebootRequired) as status by host&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| eval now=now()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| convert ctime(now) as day_of_week timeformat="%w"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| eval day_of_week_variable=case(day_of_week=0 OR day_of_week=1, 2,day_of_week=6 or day_of_week=2,1,1=1,0)&lt;/SPAN&gt;&lt;BR /&gt;| eval day_age_of_last_message=((now()-_time)/60/60/24-day_of_week_variable)&lt;BR /&gt;&lt;SPAN&gt;| eval reboot_required=if(day_age_of_last_message&amp;gt;2,"threatRebootRequired=true", "threatRebootRequired=false")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;| eval day_age_of_last_message=((now()-_time)/60/60/24-day_of_week_variable). //in this eval a open braces was missing, which I have added now.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;| eval reboot_required=if(day_age_of_last_message&amp;gt;2 AND status = true,"reboot required", "not required") //What I am supposed to give here, still I do not get the desired results of only showing results &amp;gt;2. I have also added status= true, to remove messages which are older than 2 days but do not require reboot.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I would like to have the data compared with older logs to check, if the reboot required is still true since last two days.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 12:48:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/609150#M211814</guid>
      <dc:creator>vgiri8</dc:creator>
      <dc:date>2022-08-11T12:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to check that a field value is unchanged in last two day or if possible two business days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/609246#M211857</link>
      <description>&lt;P&gt;Would this simple search do? &amp;nbsp;Assuming threatRebootRequired is reported every 5 minutes,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=my_index sourcetype=my_sourcetype isDecommissioned="false" isUninstalled="false"
| bin span=5m _time
| stats min(_time) as start max(_time) as end by threatRebootRequired
| where threatRebootRequired == "true" and now() - end &amp;lt; 300 and now() - start &amp;gt; 2*86400&lt;/LI-CODE&gt;&lt;P&gt;The above should give you those needing reboot for &amp;gt; 2 days. &amp;nbsp;To get those needing reboot for &amp;gt; 2 business days, add a week day filter, like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=my_index sourcetype=my_sourcetype isDecommissioned="false" isUninstalled="false"
| bin span=5m _time
| stats min(_time) as start max(_time) as end by threatRebootRequired
| where threatRebootRequired == "true" and now() - end &amp;lt; 300 and now() - start &amp;gt; 2*86400 and startdow &amp;gt;0 and startdow &amp;lt; 6&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 12 Aug 2022 06:08:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/609246#M211857</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-08-12T06:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to check that a field value is unchanged in last two day or if possible two business days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/609290#M211870</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I worked on the query you shared, but I am getting data as below, I would like to sort by computerName and I am using span=1d here.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;When I add the last part of the query (where threatRebootRequired == "true" and now() - end &amp;lt; 300 and now() - start &amp;gt; 2*86400) I do not get any results.&lt;/P&gt;&lt;P&gt;Please find the attached screenshot&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 09:26:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/609290#M211870</guid>
      <dc:creator>vgiri8</dc:creator>
      <dc:date>2022-08-12T09:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to check that a field value is unchanged in last two day or if possible two business days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/609351#M211894</link>
      <description>&lt;P&gt;Before addressing why your filter came out empty, I need to reveal a bigger problem with my previous code: stats should group by _time bucket as well as by host.&lt;/P&gt;&lt;P&gt;Now to the reason why the filter came empty, even though your end time is 6 days after start time (which is not what it is meant to measure because of my mistake): that "&lt;FONT face="andale mono,times"&gt;now() - end &amp;lt; 300&lt;/FONT&gt;" needs to be adjusted according to the collection period of threatRebootRequired as well as your time bucket. &amp;nbsp;For the simplistic strategy to be correct, the collection period should be equal to or larger than the time bucket which you set to be 1d. &amp;nbsp;Assuming the two are equal, that expression should be adjusted to "&lt;FONT face="andale mono,times"&gt;now() - end &amp;lt; 86400&lt;/FONT&gt;", i.e., that the last event at this state came in less than 1d ago. &amp;nbsp;If collection period is longer, adjust 86400 to that period to match the last collected event. &amp;nbsp;If collection period is shorter than time bucket, you can use latest(threatRebootRequired) as a second filter. &amp;nbsp;But that kind of ruins the simplicity.&lt;/P&gt;&lt;P&gt;Taking these two, you can try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=my_index sourcetype=my_sourcetype isDecommissioned="false" isUninstalled="false"
| bin span=1d _time
| stats min(_time) as start max(_time) as end by host _time threatRebootRequired
| where threatRebootRequired == "true" and now() - end &amp;lt; 86400 and now() - start &amp;gt; 2*86400&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 17:05:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/609351#M211894</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-08-12T17:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to check that a field value is unchanged in last two day or if possible two business days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/610677#M212380</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have attached the screenshot of (a single host, as an example) for the result I am getting if I use the below query, If I had the rest of the query, I do not get any results. We are getting the data once per day.&lt;BR /&gt;&lt;BR /&gt;index=my_index sourcetype=my_sourcetype isDecommissioned="false" isUninstalled="false"&lt;BR /&gt;| bin span=1d _time&lt;BR /&gt;| stats min(_time) as start max(_time) as end by host _time threatRebootRequired&lt;BR /&gt;| where threatRebootRequired == "true"&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 13:08:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/610677#M212380</guid>
      <dc:creator>vgiri8</dc:creator>
      <dc:date>2022-08-24T13:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to check that a field value is unchanged in last two day or if possible two business days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/610717#M212388</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/246074"&gt;@vgiri8&lt;/a&gt;&amp;nbsp;The screenshot reveals a different problem by setting _time bucket to just 1 day. &amp;nbsp;The bucket should greater than the amount of the test boundary. &amp;nbsp;With this in mind, could you test the simpler form, without group by _time for now?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=my_index sourcetype=my_sourcetype isDecommissioned="false" isUninstalled="false"
| stats min(_time) as start max(_time) as end by threatRebootRequired
| where threatRebootRequired == "true" and now() - end &amp;lt; 86400 and now() - start &amp;gt; 2*86400&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 15:52:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/610717#M212388</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-08-24T15:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to check that a field value is unchanged in last two day or if possible two business days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/610791#M212417</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;I tried as you mentioned but the number host is now only one, compared to many host in the last query. Please find attached screenshot of current output.&amp;nbsp;&lt;BR /&gt;Time range is took is same for both old and new query(without the bin _time)&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 07:55:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/610791#M212417</guid>
      <dc:creator>vgiri8</dc:creator>
      <dc:date>2022-08-25T07:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to check that a field value is unchanged in last two day or if possible two business days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/610874#M212441</link>
      <description>&lt;P&gt;Apologies again - group by host is always needed&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=my_index sourcetype=my_sourcetype isDecommissioned="false" isUninstalled="false"
| stats min(_time) as start max(_time) as end by threatRebootRequired host
| where threatRebootRequired == "true" and now() - end &amp;lt; 86400 and now() - start &amp;gt; 2*86400&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 Aug 2022 20:23:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-that-a-field-value-is-unchanged-in-last-two-day-or/m-p/610874#M212441</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-08-25T20:23:04Z</dc:date>
    </item>
  </channel>
</rss>

