<?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 How to define 2 thresholds based on time? in Other Usage</title>
    <link>https://community.splunk.com/t5/Other-Usage/How-to-define-2-thresholds-based-on-time/m-p/656642#M1346</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi Team,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to schedule a alert base on threshold for 2 time window.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If fall to 0 events between 23:00 to 07:00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If fall to less then 20 events&amp;nbsp;between&amp;nbsp; &amp;nbsp;07:00 to 23:00&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;is it possible to define 2 threshold like above ? in one alert&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;index=ABC sourcetype=XYZ login |stats count |where count =0 between23:00 to 07:00&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;index=ABC sourcetype=XYZ login |stats count |where count &amp;lt;=20 between 07:00 to 23:00&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please advise.&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Sep 2023 19:41:27 GMT</pubDate>
    <dc:creator>cbiraris</dc:creator>
    <dc:date>2023-09-05T19:41:27Z</dc:date>
    <item>
      <title>How to define 2 thresholds based on time?</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-define-2-thresholds-based-on-time/m-p/656642#M1346</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Team,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to schedule a alert base on threshold for 2 time window.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If fall to 0 events between 23:00 to 07:00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If fall to less then 20 events&amp;nbsp;between&amp;nbsp; &amp;nbsp;07:00 to 23:00&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;is it possible to define 2 threshold like above ? in one alert&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;index=ABC sourcetype=XYZ login |stats count |where count =0 between23:00 to 07:00&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;index=ABC sourcetype=XYZ login |stats count |where count &amp;lt;=20 between 07:00 to 23:00&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please advise.&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2023 19:41:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-define-2-thresholds-based-on-time/m-p/656642#M1346</guid>
      <dc:creator>cbiraris</dc:creator>
      <dc:date>2023-09-05T19:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: To define 2 threshold based on time?</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-define-2-thresholds-based-on-time/m-p/656650#M1347</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247215"&gt;@cbiraris&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;yes, you have to define a threshold value using eval:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=ABC sourcetype=XYZ login 
| stats count 
| eval time_hour=strftime(now(),"%H")
| eval threshold=if(time_hour&amp;gt;22 OR time_hour&amp;lt;8,0,20)
| where count&amp;lt;=threshold&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2023 09:07:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-define-2-thresholds-based-on-time/m-p/656650#M1347</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-09-05T09:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: To define 2 threshold based on time?</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-define-2-thresholds-based-on-time/m-p/656651#M1348</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=ABC sourcetype=XYZ login |stats count |where count=0 OR (count &amp;lt;=20 AND tonumber(strftime(now(),"%H")) &amp;gt;= 7 AND tonumber(strftime(now(),"%H")) &amp;lt; 23)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 05 Sep 2023 09:09:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-define-2-thresholds-based-on-time/m-p/656651#M1348</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-09-05T09:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: To define 2 threshold based on time?</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-define-2-thresholds-based-on-time/m-p/656654#M1349</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;Its Working&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2023 09:16:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-define-2-thresholds-based-on-time/m-p/656654#M1349</guid>
      <dc:creator>cbiraris</dc:creator>
      <dc:date>2023-09-05T09:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: To define 2 threshold based on time?</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-define-2-thresholds-based-on-time/m-p/656657#M1350</link>
      <description>&lt;P&gt;Also, can we define 2 different search run interval in this query ? like below---&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;index=ABC sourcetype=XYZ login |stats count |where count =0 between23:00 to 07:00, search can be run every after 2 hours to check last 2 hours events&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;AND&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;index=ABC sourcetype=XYZ login |stats count |where count &amp;lt;=20 between 07:00 to 23:00,&amp;nbsp;, search can be run every after 1 hours to check last 1 hours events&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2023 09:26:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-define-2-thresholds-based-on-time/m-p/656657#M1350</guid>
      <dc:creator>cbiraris</dc:creator>
      <dc:date>2023-09-05T09:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: To define 2 threshold based on time?</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-define-2-thresholds-based-on-time/m-p/656663#M1351</link>
      <description>&lt;P&gt;You can do this in one alert but it gets a bit messy - you would probably be better off using two alerts with different schedules, time periods and alert criteria&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2023 10:34:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-define-2-thresholds-based-on-time/m-p/656663#M1351</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-09-05T10:34:23Z</dc:date>
    </item>
  </channel>
</rss>

