<?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: Need Help with a Splunk Search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-a-Splunk-Search-and-modifying-thresholds-based/m-p/641151#M222128</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/94646"&gt;@phularah&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you don't need to use case and if, try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Threshold = case(strftime(_time,"%a")="Sat" AND host="a1", Threshold=1, strftime(_time,"%a")="Sun" AND host="a1", Threshold=1, strftime(_time,"%a")="Sun" AND host="a2", Threshold=1.5, strftime(_time,"%a")="Sun" AND host="a2", Threshold=1.5)&lt;/LI-CODE&gt;&lt;P&gt;Then use always quotes for each strings.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Mon, 24 Apr 2023 15:33:33 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-04-24T15:33:33Z</dc:date>
    <item>
      <title>Need Help with a Splunk Search and modifying thresholds based don day and time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-a-Splunk-Search-and-modifying-thresholds-based/m-p/641089#M222111</link>
      <description>&lt;P&gt;I am trying to modify Thresholds based on the day and time. I have the chart completed, just need help with the thresholds.&lt;BR /&gt;If the day is Saturday or Sunday and host is a1, Threshold should be 1, if host is a2 with same timing conditions, threshold should be 1.5 and for other remaining hosts threshold should be 0.5&amp;nbsp;with same timing conditions.&lt;BR /&gt;&lt;BR /&gt;If the day is Monday-Friday, and time is between 12:00am to 12:pm, for host a1 threshold should be 3, and for same timing conditions for host a2 threshold should be 4 and for other remaining hosts threshold should be 1 with same timing conditions.&lt;BR /&gt;&lt;BR /&gt;The search that I am trying is something like as shown below, but there are multiple hosts and it is not working for a single host and I need to change thresholds based on time of that particular day as well.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;| eval Threshold = case (if(strftime(_time,"%a")="Sat" AND host="a1"), Threshold=1, if(strftime(_time,"%a")=Sun AND host="a1"), Threshold=1, if(strftime(_time,"%a")="Sun" AND host="a2"), Threshold=1.5, if(strftime(_time,"%a")="Sun" AND host="a2"), Threshold=1.5)&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 14:43:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-a-Splunk-Search-and-modifying-thresholds-based/m-p/641089#M222111</guid>
      <dc:creator>phularah</dc:creator>
      <dc:date>2023-04-24T14:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a Splunk Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-a-Splunk-Search-and-modifying-thresholds-based/m-p/641093#M222113</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/94646"&gt;@phularah&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you could create a lookup containing the conditions and the threshold: day, host, threshold,&lt;/P&gt;&lt;P&gt;then you could add to you search the lookup like this following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| lookup thresholds.csv day host OUTPUT_threshold
| ...&lt;/LI-CODE&gt;&lt;P&gt;In this way you can easily manage all the conditions.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 09:17:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-a-Splunk-Search-and-modifying-thresholds-based/m-p/641093#M222113</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-04-24T09:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a Splunk Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-a-Splunk-Search-and-modifying-thresholds-based/m-p/641106#M222118</link>
      <description>&lt;P&gt;I need help with case, if and strftime functions. I am doing something wrong and getting error that arguments to the if function are invalid.&lt;BR /&gt;I have used various permutations and combinations with strptime and strftime as well.&lt;BR /&gt;&lt;BR /&gt;Also, the threshold needs to be changed depending on the time of the day.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 10:42:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-a-Splunk-Search-and-modifying-thresholds-based/m-p/641106#M222118</guid>
      <dc:creator>phularah</dc:creator>
      <dc:date>2023-04-24T10:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a Splunk Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-a-Splunk-Search-and-modifying-thresholds-based/m-p/641151#M222128</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/94646"&gt;@phularah&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you don't need to use case and if, try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Threshold = case(strftime(_time,"%a")="Sat" AND host="a1", Threshold=1, strftime(_time,"%a")="Sun" AND host="a1", Threshold=1, strftime(_time,"%a")="Sun" AND host="a2", Threshold=1.5, strftime(_time,"%a")="Sun" AND host="a2", Threshold=1.5)&lt;/LI-CODE&gt;&lt;P&gt;Then use always quotes for each strings.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 15:33:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-a-Splunk-Search-and-modifying-thresholds-based/m-p/641151#M222128</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-04-24T15:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a Splunk Search and modifying thresholds based don day and time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-a-Splunk-Search-and-modifying-thresholds-based/m-p/641545#M222243</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Threshold = case(strftime(_time,"%a")="Sat" AND host="a1",1, strftime(_time,"%a")="Sun" AND host="a1",1, strftime(_time,"%a")="Sun" AND host="a2",1.5, strftime(_time,"%a")="Sun" AND host="a2",1.5)

It worked. Thanks gcusello.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 07:12:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-a-Splunk-Search-and-modifying-thresholds-based/m-p/641545#M222243</guid>
      <dc:creator>phularah</dc:creator>
      <dc:date>2023-04-27T07:12:59Z</dc:date>
    </item>
  </channel>
</rss>

