<?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: Show error details when errors  10% higher than previous 30 mins? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Show-error-details-when-errors-10-higher-than-previous-30-mins/m-p/621855#M216171</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;thanks, this example is much more straight forward. I have used that as guide and changed my code to meet my needs and this seems to work well now&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex source=mysource sourcetype=mysourcetype FailureReason IN ("*Error1*", "*Error2*", "*Error3*") earliest=-60m
| eventstats count sum(eval(if(_time &amp;gt; relative_time(now(), "-30m"), 1, 0))) as current_30m  ```Get current```
| eventstats count sum(eval(if(_time &amp;lt; relative_time(now(), "-30m"), 1, 0))) as previous_30m ```Get previous```
| eval show_detail = if(round(((current_30m-previous_30m)/previous_30m),4)&amp;gt;0.1, "True", null()) ```Get percentage change compared to previous 30 mins```
| where isnotnull(show_detail) AND _time &amp;gt; relative_time(now(), "-30m")
| table ReqReceivedTimestamp, APIName, ReqUrl, ShopName, ResponseCode, FailureReason, FailureServiceCalloutResponse&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Nov 2022 14:35:56 GMT</pubDate>
    <dc:creator>MikeyD100</dc:creator>
    <dc:date>2022-11-23T14:35:56Z</dc:date>
    <item>
      <title>Show error details when errors  10% higher than previous 30 mins?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-error-details-when-errors-10-higher-than-previous-30-mins/m-p/621750#M216129</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I want to display the error details in the last 30 mins, so they can be investigated, when the amount of errors has increased by 10% from the previous 30mins.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;Search 1&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;This is the search for the data I want to show in the results&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=myindex source=mysource sourcetype=mysourcetype FailureReason IN ("*Error1*", "*Error2*", "*Error3*")
| table ReqReceivedTimestamp, APIName, ReqUrl, ShopName, ResponseCode, FailureReason, FailureServiceCalloutResponse&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;Search 2&lt;BR /&gt;&lt;/STRONG&gt;&lt;/U&gt;This is the search I have to work out if there are over 10% compared to the last 30 mins&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=myindex source=mysource sourcetype=mysourcetype FailureReason IN ("*Error1*", "*Error2*", "*Error3*")
| timechart span=30m count as server
| streamstats window=1 current=f values(server) as last30
| eval difference=server-last30
| eval percentage_change=round((difference/last30)*100,2)
| eval AboveThreshold=if(round(((server-last30)/last30),4)&amp;gt;.10, "True", null())
| where AboveThreshold = "True"
| table percentage_change&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I want to understand what is the best way to get these 2 searches combined and show the table from Search 1 when&amp;nbsp;&amp;nbsp;Search 2 &amp;gt;10%&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 04:10:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-error-details-when-errors-10-higher-than-previous-30-mins/m-p/621750#M216129</guid>
      <dc:creator>MikeyD100</dc:creator>
      <dc:date>2022-11-23T04:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Show error details when errors  10% higher than previous 30 mins?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-error-details-when-errors-10-higher-than-previous-30-mins/m-p/621787#M216142</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234543"&gt;@MikeyD100&lt;/a&gt;&amp;nbsp;- Sorry I haven't looked at your second search closely. I'm expecting that is working as you need and give a solution to combine these searches.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex source=mysource sourcetype=mysourcetype FailureReason IN ("*Error1*", "*Error2*", "*Error3*")

| search [index=myindex source=mysource sourcetype=mysourcetype FailureReason IN ("*Error1*", "*Error2*", "*Error3*")
| timechart span=30m count as server
| streamstats window=1 current=f values(server) as last30
| eval difference=server-last30
| eval percentage_change=round((difference/last30)*100,2)
| eval AboveThreshold=if(round(((server-last30)/last30),4)&amp;gt;.10, "True", null())
| eval sourcetype=if(AboveThreshold="True", "SEARCH_SOMETHING_RANDOM_RANDOM_RANDOM", "*")
| table sourcetype]

| table ReqReceivedTimestamp, APIName, ReqUrl, ShopName, ResponseCode, FailureReason, FailureServiceCalloutResponse&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this works as you expects.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 06:12:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-error-details-when-errors-10-higher-than-previous-30-mins/m-p/621787#M216142</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-11-23T06:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Show error details when errors  10% higher than previous 30 mins?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-error-details-when-errors-10-higher-than-previous-30-mins/m-p/621822#M216161</link>
      <description>&lt;P&gt;The second search is much too complicated for the task at hand. &amp;nbsp;Combine the two with an extremely literal interpretation of your requirement.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex source=mysource sourcetype=mysourcetype FailureReason IN ("*Error1*", "*Error2*", "*Error3*") earliest=-60m
| eventstats count sum(eval(if(_time &amp;lt; relative_time(now(), "-30m"), 1, 0))) as previous_30m
| eval show_detail = if(count &amp;gt; previous_30m * 2.1, "yes", null()) ``` current &amp;gt; 1.1 * previous ==&amp;gt; (current + previous) &amp;gt; 2.1 * previous ```
| where isnotnull(show_detail) AND _time &amp;gt; relative_time(now(), "-30m") ``` only show current period ```
| table ReqReceivedTimestamp, APIName, ReqUrl, ShopName, ResponseCode, FailureReason, FailureServiceCalloutResponse&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 08:50:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-error-details-when-errors-10-higher-than-previous-30-mins/m-p/621822#M216161</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-11-23T08:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Show error details when errors  10% higher than previous 30 mins?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-error-details-when-errors-10-higher-than-previous-30-mins/m-p/621855#M216171</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;thanks, this example is much more straight forward. I have used that as guide and changed my code to meet my needs and this seems to work well now&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex source=mysource sourcetype=mysourcetype FailureReason IN ("*Error1*", "*Error2*", "*Error3*") earliest=-60m
| eventstats count sum(eval(if(_time &amp;gt; relative_time(now(), "-30m"), 1, 0))) as current_30m  ```Get current```
| eventstats count sum(eval(if(_time &amp;lt; relative_time(now(), "-30m"), 1, 0))) as previous_30m ```Get previous```
| eval show_detail = if(round(((current_30m-previous_30m)/previous_30m),4)&amp;gt;0.1, "True", null()) ```Get percentage change compared to previous 30 mins```
| where isnotnull(show_detail) AND _time &amp;gt; relative_time(now(), "-30m")
| table ReqReceivedTimestamp, APIName, ReqUrl, ShopName, ResponseCode, FailureReason, FailureServiceCalloutResponse&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 14:35:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-error-details-when-errors-10-higher-than-previous-30-mins/m-p/621855#M216171</guid>
      <dc:creator>MikeyD100</dc:creator>
      <dc:date>2022-11-23T14:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Show error details when errors  10% higher than previous 30 mins?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-error-details-when-errors-10-higher-than-previous-30-mins/m-p/621861#M216172</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234543"&gt;@MikeyD100&lt;/a&gt;&amp;nbsp;- Kindly accept the answer that helped you resolve your query by clicking on "Accept as Solution", this helps other users in the community.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 15:15:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-error-details-when-errors-10-higher-than-previous-30-mins/m-p/621861#M216172</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-11-23T15:15:24Z</dc:date>
    </item>
  </channel>
</rss>

